Commit Graph

262 Commits

Author SHA1 Message Date
Takeshi KOMIYA
9256daaa77
Merge branch '3.x' into 6857_enum_classmethod 2020-05-02 01:48:01 +09:00
Takeshi KOMIYA
25fc47e6b7 Fix #7559: autodoc: misdetects a sync function is async 2020-05-01 22:05:45 +09:00
Takeshi KOMIYA
d612ef8f0b Fix #6857: autodoc: failed to detect a classmethod on Enum class 2020-04-30 22:54:49 +09:00
Takeshi KOMIYA
767864b0f1 Close #7143: autodoc: Support final classes and methods 2020-04-28 01:24:41 +09:00
Takeshi KOMIYA
1cffff2a30
Merge pull request #7487 from thomascobb/singledispatch_autofunction
Support singledispatch autodoc directives
2020-04-27 22:48:02 +09:00
Takeshi KOMIYA
7888600f96
Merge pull request #7564 from eric-wieser/fix-missing-__annotations__
autodoc: Fix a logic error that causes annotations not to be shown for descriptors
2020-04-27 21:54:17 +09:00
Eric Wieser
b7ce4a4c13 Fix a logic error that causes annotations not to be shown for descriptors
This `if not self._datadescriptor` was originally here before type annotations were supported, to prevent showing `descr4 = <_Descriptor ...>` in the docs.

When type annotations were added, the support for appending `:type:` was put in the wrong place.
It should have been outside this if, not within it.
2020-04-27 12:57:39 +01:00
Tom Cobb
22fafb9773 Support singledispatch in autofunction/methodThis makes autofunction and automethod work standalone withsingledispatch functions and methods. Previously only automodule wouldsupport these 2020-04-24 15:25:50 +01:00
Takeshi KOMIYA
6b07d8f363 autodoc: Suppress default value for uninitialized variables 2020-04-20 01:48:05 +09:00
Takeshi KOMIYA
a42de07bcf Close #2044: autodoc: Suppress default value for instance attributes 2020-04-20 01:29:01 +09:00
Takeshi KOMIYA
becc798d36 test: Fix indentation 2020-04-05 23:49:08 +09:00
Takeshi KOMIYA
231d75b0d0 Merge branch '2.x' into 3.0.x 2020-04-05 23:03:35 +09:00
Takeshi KOMIYA
360efdefec Fix #7355: autodoc: a signature of cython-function is not recognized well 2020-03-31 21:14:08 +09:00
Takeshi KOMIYA
dd70d9faac Fix #7331: autodoc: a cython-method is not recognized as a method 2020-03-22 23:13:49 +09:00
Takeshi KOMIYA
5c396b6325 Fix #7331: autodoc: a cython-function is not recognized as a function 2020-03-22 23:13:49 +09:00
Takeshi KOMIYA
91a22a3ecc
Merge pull request #7358 from tk0miya/refactor_autodoc
refactor: autodoc: Remove needless spaces from blank line
2020-03-22 17:55:32 +09:00
Takeshi KOMIYA
9ebad705b8 refactor: autodoc: Remove needless spaces from blank line 2020-03-22 17:47:18 +09:00
Jakob Lykke Andersen
0eb3ad22bf Update autodoc tests for new backslash handling 2020-03-20 18:31:29 +01:00
Takeshi KOMIYA
8f7cc26b20 autodoc: Support singledispatch methods 2020-03-07 17:50:10 +09:00
Takeshi KOMIYA
961b4d1545 Close #2815: autodoc: Support singledispatch functions 2020-03-07 17:50:10 +09:00
Takeshi KOMIYA
34057601f4 Close #7165: autodoc: Support Annotated type (PEP-593) 2020-03-03 00:14:24 +09:00
Terence D. Honles
90de551d4c Fix: autodoc: __wrapped__ functions are not documented correctly
Functions that are decorated with `@lru_cache` or other `functools`
decorators may not even be detected as a function. This results in the
documentation not having the `()` or even trying to render the function
signature.

This change updates the `sphinx.util.inspect` code to unwrap
`__wrapped__` functions before determining if they can be documented.

`@lru_cache` and its associated test is an example of a decorated
function that is incorrectly identified as an attribute rather than a
module level function and when rendering the signature (upon changing
`isattributedescriptor`) the decorated function is still incorrectly
identified as a C function.

This change also renames the newly introduced `unwrap` as `unwrap_all`
because it is different than the prexisting Python supplied
`inspect.unwrap`.

See `update_wrapper` "Changed in version 3.4" for more background:
https://docs.python.org/3/library/functools.html#functools.update_wrapper
2020-02-27 16:27:41 -08:00
Takeshi KOMIYA
754d04f80d Merge branch '2.4.x' into 3.x 2020-02-22 19:22:31 +09:00
Takeshi KOMIYA
2fec37219f Fix #7189: autodoc: classmethod coroutines are not detected 2020-02-22 00:49:45 +09:00
Takeshi KOMIYA
c5f0025ed9 Merge branch 'master' into 5637 2020-02-12 01:42:05 +09:00
Takeshi KOMIYA
2e87ee85a2 Merge branch '2.0' 2020-02-09 00:57:53 +09:00
Takeshi KOMIYA
92cb828f14 autodoc: Support type_comment styled type annotation for variables 2020-02-03 01:19:05 +09:00
Takeshi KOMIYA
20126433d6 autodoc: Show type annotation for instance variables 2020-02-03 01:18:38 +09:00
Takeshi KOMIYA
5e4e44c195 autodoc: Support type annotations for variables 2020-02-03 01:16:21 +09:00
Takeshi KOMIYA
e7a0af807a Merge branch '2.0' 2020-01-30 23:29:32 +09:00
Takeshi KOMIYA
dcd8f41a77 Add testcase for instance variables without defaults 2020-01-26 01:25:35 +09:00
Takeshi KOMIYA
ecf38edb43 Close #7051: autodoc: Support instance variables without defaults (PEP-526) 2020-01-25 00:57:36 +09:00
Takeshi KOMIYA
4e257a8084 Merge branch '2.0' into 7023_partial_listed_as_module_members 2020-01-19 23:09:46 +09:00
Takeshi KOMIYA
347e301727 Merge branch '2.0' 2020-01-19 22:47:02 +09:00
Takeshi KOMIYA
a1f6bbf800
Merge pull request #7031 from tk0miya/7023_nested_partial_functions_not_listed
#7023: autodoc: nested partial functions are not listed
2020-01-19 15:49:52 +09:00
Takeshi KOMIYA
53e38ccc30 Fix #7023: autodoc: partial functions are listed as module members 2020-01-19 15:22:09 +09:00
Takeshi KOMIYA
e908e43f67 Fix #7023: autodoc: nested partial functions are not listed 2020-01-17 09:15:45 +09:00
Takeshi KOMIYA
7906a6871e Add testcase a partialmethod not having docstring (refs: #7023) 2020-01-17 09:11:59 +09:00
Takeshi KOMIYA
cad1f86dd8 Merge branch '2.0' 2020-01-11 02:56:58 +09:00
Takeshi KOMIYA
5867416612 refactor: Add sphinx.util.inspect.signature()
As a successor of sphinx.util.inspect.Singnature, this adds
signature() function behaves like `inspect.signature()`.  It is
very similar to way of python's inspect module.

In addition, this also adds stringify_annotation() helper to
sphinx.util.inspect module.  With these two functions, we can move
to python's Signature object to represent function signatures
perfectly.  It's natural design for python developers than ever.
2020-01-09 00:32:07 +09:00
Takeshi KOMIYA
0319faf8f1 Merge branch '2.0' 2020-01-01 14:40:39 +09:00
Takeshi KOMIYA
eaf495c3c4 A happy new year! 2020-01-01 14:27:43 +09:00
Takeshi KOMIYA
7c79a6b8d1 Close #5923: autodoc: allow not to document inherited members of specific super class 2019-12-01 12:51:28 +09:00
Takeshi KOMIYA
e0eb86224d Merge branch '2.1.1' into 2.0 2019-06-10 22:31:18 +09:00
Takeshi KOMIYA
21be789d4d Revert "Fix #1063: autodoc: automodule directive handles undocumented module level variables"
This reverts commit 69d93c967c (without
CHANGES).
2019-06-10 21:40:11 +09:00
Takeshi KOMIYA
81e2e1d971 test: Update testcase for autoclass_content and autodoc_docstring_signature 2019-06-03 23:20:33 +09:00
Takeshi KOMIYA
f7851b62e0 test: Update testcase for autoclass_content 2019-06-03 23:20:33 +09:00
Takeshi KOMIYA
f4114bb794 test: Update testcase for autodoc_inherit_docstrings 2019-06-03 22:34:35 +09:00
Takeshi KOMIYA
42e9fd896e test: Move class inheritance samples into target.inheritance module 2019-06-03 22:34:33 +09:00
Takeshi KOMIYA
c8554e7673 test: Move testcases for autodoc events to test_ext_autodoc_events 2019-06-03 01:32:36 +09:00