Commit Graph

297 Commits

Author SHA1 Message Date
Takeshi KOMIYA
8f4c2fb08d refactor: py domain: Add type_to_xref() utility 2020-05-04 14:29:55 +09:00
Takeshi KOMIYA
75203967d8 Merge branch '3.x' 2020-05-04 00:15:20 +09:00
Takeshi KOMIYA
41b4a77dea Add stacklevel parameter to warnings.warn() call 2020-05-03 23:34:35 +09:00
Takeshi KOMIYA
71eddf3095 Merge branch '3.x' 2020-04-30 21:49:28 +09:00
Takeshi KOMIYA
a86346aca6 Remove deprecated features marked as RemovedInSphinx40Warning 2020-04-29 15:12:39 +09:00
Takeshi KOMIYA
87308d9607 Close #7143: py domain: Add :final: option to py:*: directives 2020-04-28 01:24:29 +09:00
Takeshi KOMIYA
1aca70cf80 Merge branch '3.x' 2020-04-13 23:36:49 +09:00
Takeshi KOMIYA
a4edbc1104
Merge pull request #7462 from tk0miya/7461_empty_tuple
Fix #7461: py domain: fails with IndexError for empty tuple in type annotation
2020-04-13 23:34:15 +09:00
Takeshi KOMIYA
2e219366c4 Fix #7461: py domain: fails with IndexError for empty tuple in type annotation 2020-04-12 12:57:22 +09:00
Takeshi KOMIYA
fd7c1d76b6 Merge branch '3.0.x' into 3.x 2020-04-11 00:04:45 +09:00
Takeshi KOMIYA
d9d381de11 Fix #7445: a return annotation `None` is not converted to a hyperlink 2020-04-10 02:07:02 +09:00
Takeshi KOMIYA
b2ab2c6325 Fix #7428: py domain: a reference to class `None` emits a nitpicky warning 2020-04-08 01:49:24 +09:00
Takeshi KOMIYA
5b9e3fbf2e Fix mypy violations 2020-04-06 00:43:52 +09:00
Takeshi KOMIYA
4860b451f2 Merge branch '3.x' 2020-04-06 00:23:29 +09:00
Takeshi KOMIYA
4c1b8b8db6 Merge branch '3.0.x' into 3.x 2020-04-05 23:04:19 +09:00
Takeshi KOMIYA
3a95fa7336
Merge pull request #7363 from tk0miya/refactor_pydomain
refactor: py domain: Use namedtuple for python objects and modules
2020-03-30 01:34:40 +09:00
Takeshi KOMIYA
fe9473f42e Fix #7219: py:module directive generates incorrect index entry 2020-03-29 19:37:21 +09:00
Takeshi KOMIYA
ce25d0080e Fix #7219: py:function directive generates incorrect index entry 2020-03-29 19:37:19 +09:00
Takeshi KOMIYA
90fb44ee43 Merge branch '3.x' 2020-03-23 00:07:51 +09:00
Takeshi KOMIYA
8edae5fe28
Merge pull request #7356 from tk0miya/7301_node_id
Fix #7301: Allow . and _ for node_id
2020-03-22 23:42:56 +09:00
Takeshi KOMIYA
4889415bd8 refactor: py domain: Use namedtuple for python modules 2020-03-22 22:41:27 +09:00
Takeshi KOMIYA
89c2905ed3 refactor: py domain: Use namedtuple for python objects 2020-03-22 22:09:50 +09:00
Takeshi KOMIYA
b0a6b3f285 Close #7341: py domain: type annotations are converted to cross refs 2020-03-22 17:10:00 +09:00
Takeshi KOMIYA
7bbf79c313 Fix #7301: Allow . and _ for node_id
In development of 3.0, Sphinx starts to obey to the rule of
"Identifier Normalization" of docutils.  This extends it to allow
dots(".") and underscores("_") for node identifier.

It allows Sphinx to generate node identifier from source string as
possible as it is (bacause dots and underscores are usually used in
many programming langauges).

This change will keep not to break hyperlinks as possible.
2020-03-22 16:39:00 +09:00
Takeshi KOMIYA
c7e590818a Merge branch '3.x' 2020-03-21 17:53:22 +09:00
Takeshi KOMIYA
b72bc26c1a Fix #7334: py domain: Disable smartquotes for defvalues of arguments 2020-03-19 00:31:47 +09:00
Takeshi KOMIYA
5c0d0438c4
Merge pull request #6990 from tk0miya/function_signature
py domain: Allow to make a style for arguments of functions and methods
2020-03-14 17:42:04 +09:00
Takeshi KOMIYA
50cf68e0d4 py domain: Allow to make a style for arguments of functions and methods (refs: #6417) 2020-03-14 16:55:55 +09:00
Takeshi KOMIYA
d134b51927 Fix #7304: py domain: Improve warning messages on parsing failure 2020-03-14 13:54:49 +09:00
Takeshi KOMIYA
e116613a3a Merge branch '3.x' 2020-03-10 01:15:52 +09:00
Takeshi KOMIYA
42be967b2d Merge branch '2.x' into 3.x 2020-03-10 01:14:39 +09:00
Takeshi KOMIYA
a73617c51b
Merge pull request #7275 from tk0miya/refactor_pydecorator
py domain: refactor PyDecoratorFunction and PyDecoratorMethod
2020-03-08 15:07:09 +09:00
Takeshi KOMIYA
8e1934b6a1 Close #7246: Drop special cross reference helper for exceptions, functions and methods 2020-03-07 23:19:54 +09:00
Takeshi KOMIYA
d49bec1c67 py domain: Deprecate PyDecoratorMixin 2020-03-07 23:13:06 +09:00
Takeshi KOMIYA
3cadc82559 py domain: refactor PyDecoratorFunction and PyDecoratorMethod 2020-03-07 23:12:41 +09:00
Takeshi KOMIYA
cfb9f8387b Fix #7266: Update deprecation messages for PyClassmember and PyModulelevel 2020-03-07 22:56:37 +09:00
Takeshi KOMIYA
6d4fefebf4 Deprecate codes for python 3.5 2020-03-07 19:36:41 +09:00
Takeshi KOMIYA
7652052bf8
Merge pull request #7254 from tk0miya/6895_suppress_builtin_nitpicky_warning
Fix #6895: py domain: Do not emit nitpicky warnings for built-in types
2020-03-07 02:12:50 +09:00
Takeshi KOMIYA
729efd28b0 py domain: Generate node_id for objects in the right way 2020-03-07 02:00:50 +09:00
Takeshi KOMIYA
5ff3b9dc4d py domain: Generate node_id for modules in the right way 2020-03-07 01:48:17 +09:00
Takeshi KOMIYA
09623a97d0 Merge branch '2.x' into 3.x 2020-03-05 23:11:14 +09:00
Takeshi KOMIYA
34460157e7 Fix #6895: py domain: Do not emit nitpicky warnings for built-in types 2020-03-05 22:57:56 +09:00
Takeshi KOMIYA
523b653cd9 Fix typo 2020-03-05 20:51:43 +09:00
Daniel Hahler
58b39918fd Use a string with warning in handle_signature
Previously it would pass in the exception object itself, which then
might crash filters that are using `record.msg.startswith` etc.

The warning was triggered for me with `sig = foo: int = -1`, where it
appears to not handle negative numbers (have not investigated).
2020-03-05 01:15:55 +01:00
Takeshi KOMIYA
728c6cb5ee refactor: Update type annotation for python domain 2020-03-04 00:24:08 +09:00
Takeshi KOMIYA
de52e77bc0 refactor: Set source_info to nodes 2020-02-29 17:00:58 +09:00
Takeshi KOMIYA
01eff916d1 Fix missing commas after PEP-570 separators 2020-02-24 02:03:15 +09:00
Takeshi KOMIYA
2b70875f6a Merge branch 'drop_desc_signature_first' into 3.x 2020-02-22 17:39:56 +09:00
Takeshi KOMIYA
c4d7f4d6c8 py domain: Use AST parser to convert signature to doctree 2020-02-16 01:52:04 +09:00
Takeshi KOMIYA
df3c0448dd Deprecate desc_signature['first'] 2020-02-09 00:58:42 +09:00
Takeshi KOMIYA
2e87ee85a2 Merge branch '2.0' 2020-02-09 00:57:53 +09:00
Takeshi KOMIYA
ecf7307023
Merge branch '2.0' into 6785_attr_can_refer_props 2020-02-06 22:30:50 +09:00
Takeshi KOMIYA
179a1f9cc2 py domain: Support type annotations for variables
This adds ``:type:`` and ``:value:`` options to both ``py:data``
and ``py:attribute`` directives.  It allows to describe its
annotation in detail.
2020-02-01 12:58:27 +09:00
Takeshi KOMIYA
33fcd393ab Fix #6785: py domain: :py:attr: is able to refer properties again 2020-01-25 13:55:27 +09:00
Takeshi KOMIYA
b968bb91e9 Close #6830: autodoc: consider a member private if docstring has "private" metadata 2020-01-04 13:28:07 +09:00
Takeshi KOMIYA
e628afd5cd Merge branch '2.0' 2020-01-01 11:39:46 +09:00
Takeshi KOMIYA
fc523c3ccf A happy new year! 2020-01-01 11:15:42 +09:00
Takeshi KOMIYA
5640cf879f Merge branch '2.0' 2019-12-22 18:47:30 +09:00
Antony Lee
814513ba9f Replace a and b or c by the more legible b if a or c. 2019-12-21 11:50:18 +01:00
jfbu
685e3fdb49 Merge branch '2.0' 2019-08-01 17:49:24 +02:00
Takeshi KOMIYA
0c48a28ad7 Fix type annotation for python 3.5.1 2019-07-13 23:46:17 +09:00
Takeshi KOMIYA
c18dcf08f9 Merge branch '2.0' 2019-06-30 01:08:48 +09:00
Takeshi KOMIYA
ee6e44a04f Migrate to py3 style type annotation: sphinx.domains.python 2019-06-30 00:56:32 +09:00
Takeshi KOMIYA
9f470cec6c Merge branch '2.0' 2019-06-09 01:27:34 +09:00
Takeshi KOMIYA
84df4c6c2d Fix py domain: duplicated warning does not point the location of source code 2019-06-02 22:50:59 +09:00
Takeshi KOMIYA
b9d7239d90 Merge branch '2.0' 2019-05-29 00:51:25 +09:00
Takeshi KOMIYA
557d8d140e
Merge pull request #6365 from tk0miya/refactor_py_domain
Add :abstractmethod: option to py:method directive and support abstractmethod by autodoc
2019-05-19 23:46:34 +09:00
Takeshi KOMIYA
8ed6a9ceb4 Fix #6379: py domain: Module index (py-modindex.html) has duplicate titles 2019-05-19 22:19:13 +09:00
Takeshi KOMIYA
358e582490 Add :abstractmethod: option to py:method directive (refs: #6138) 2019-05-15 00:00:51 +09:00
Takeshi KOMIYA
f63abac2ca Merge branch '2.0' 2019-05-13 22:03:26 +09:00
Takeshi KOMIYA
a142a654fc Add :property: option to py:method directive 2019-05-12 15:53:39 +09:00
Takeshi KOMIYA
37a5736a1f Merge branch '2.0' 2019-05-06 21:09:43 +09:00
jfbu
65ac90773d Merge branch '2.0' 2019-04-23 14:48:17 +02:00
Takeshi KOMIYA
e0abb10792 Fix #4777: Add :async: option to py:function and py:method directives 2019-04-23 01:40:37 +09:00
Takeshi KOMIYA
efc3405c6f Merge branch '2.0' 2019-04-14 19:35:33 +09:00
Takeshi KOMIYA
331594e2ca Add :classmethod: and :staticmethod: options to py:method directive 2019-04-13 23:14:59 +09:00
Takeshi KOMIYA
6af3896103 Add PyFunction and PyVariable; directives for python functions and variables 2019-04-13 20:26:07 +09:00
Takeshi KOMIYA
b0b3f5a677 deprecate PyClassmember class 2019-04-07 22:41:10 +09:00
Takeshi KOMIYA
fcc964b66f Add PyAttribute class; a directive for python attribute description 2019-04-07 22:40:08 +09:00
Takeshi KOMIYA
c8334705ca Add PyClassMethod and PyStaticMethod; directives for python method description 2019-04-07 22:39:27 +09:00
Takeshi KOMIYA
dd6c79476f Add PyMethod class; a directive for python method description 2019-04-07 22:39:27 +09:00
Takeshi KOMIYA
df05d9254d Merge branch '2.0' 2019-04-07 19:29:52 +09:00
Takeshi KOMIYA
e05e349277
Merge pull request #6236 from tk0miya/refactor_pydomain3
Add data accessors and helper methods to PythonDomain
2019-04-06 14:24:30 +09:00
Takeshi KOMIYA
0e837370f5 Add PythonDomain.note_module() to register a python module to the domain 2019-03-31 20:25:09 +09:00
Takeshi KOMIYA
259be8716a Add PythonDomain.note_module() to register a python object to the domain 2019-03-31 20:25:02 +09:00
Takeshi KOMIYA
f7a32746d3 Add "modules" property to PythonDomain 2019-03-31 20:18:11 +09:00
Takeshi KOMIYA
67b56eb472 Add "objects" property to PythonDomain 2019-03-31 19:55:10 +09:00
Takeshi KOMIYA
3fa466b728 Update type annotations for python domain 2019-03-31 19:15:41 +09:00
Takeshi KOMIYA
61098a0ae2 Drop features and APIs deprecated in 1.8 2019-03-30 14:50:37 +09:00
Takeshi KOMIYA
e008da9926 Merge branch '2.0' 2019-03-29 00:30:09 +09:00
Takeshi KOMIYA
12b682958e refactor PyObject class 2019-03-23 22:45:15 +09:00
Takeshi KOMIYA
700be75a73 Fix #6196: py domain: unexpected prefix is generated 2019-03-23 22:32:37 +09:00
Takeshi KOMIYA
dbefc9865d Clean up import for annotations 2019-03-06 23:44:44 +09:00
Takeshi KOMIYA
b9b6930e28 Fix mypy violations 2019-02-14 00:37:37 +09:00
Takeshi KOMIYA
76e9f57c2e Merge branch '1.8' 2019-01-02 16:16:25 +09:00
Takeshi KOMIYA
1b1ebd2c75 A happy new year! 2019-01-02 16:00:30 +09:00
Jon Dufresne
bade33c7e4 Remove unnecessary encoding cookie from Python source files
In Python 3, the default encoding of source files is utf-8. The encoding
cookie is now unnecessary and redundant so remove it. For more details,
see the docs:

https://docs.python.org/3/howto/unicode.html#the-string-type

> The default encoding for Python source code is UTF-8, so you can
> simply include a Unicode character in a string literal ...

Includes a fix for the flake8 header checks to stop expecting an
encoding cookie.
2018-12-16 12:22:12 -08:00
Jon Dufresne
ade973f4e3 Use Python 3 super() argument-less syntax
The form is less verbose and more idiomatic for Python 3 only code.

https://docs.python.org/3/library/functions.html#super
2018-12-15 08:35:55 -08:00
Takeshi KOMIYA
6bc357140d Replace all "unicode" type by "str" 2018-12-15 23:57:43 +09:00
Takeshi KOMIYA
9dfc5e7efe Add docutils-stubs to test deps 2018-12-15 02:42:43 +09:00