Commit Graph

4802 Commits

Author SHA1 Message Date
Takeshi KOMIYA
c0f923ee6c refactor: Deprecate AttributeDocumenter.isinstanceattribute() 2020-12-29 20:06:29 +09:00
Takeshi KOMIYA
3f7bf48715 Merge branch '3.4.x' into 3.x 2020-12-29 18:33:36 +09:00
Takeshi KOMIYA
85567748d9 Fix #8164: autodoc: Classes that inherit mocked class are not documented
Use ismock() to check a module member is a mocked or not. It allows not
to skip subclasses of mocked class.
2020-12-29 00:26:23 +09:00
Takeshi KOMIYA
f18e988dea Merge pull request #8601 from tk0miya/8306_autosummary_mocks_are_documented
Fix #8306: autosummary: mocked modules are documented as empty page
2020-12-28 17:42:22 +09:00
Takeshi KOMIYA
150f788e0e Merge pull request #8600 from tk0miya/8132_project_copyright
Close #8132: Add project_copyright confval as an alias of copyright
2020-12-28 17:26:49 +09:00
Takeshi KOMIYA
05518851d3 Merge branch '3.x' into 8306_autosummary_mocks_are_documented 2020-12-28 17:25:09 +09:00
Takeshi KOMIYA
146092e35a Merge branch '3.x' into 8094_texinfo_images_not_copied 2020-12-28 16:48:02 +09:00
Takeshi KOMIYA
c5a9d04d45 Merge branch '3.x' into 8132_project_copyright 2020-12-28 13:56:11 +09:00
Takeshi KOMIYA
0d84818739 Fix #8594: autodoc: empty __all__ attribute is ignored
An empty `__all__` should be represented as "there is no public items".
But autodoc considers all items on the module are public.  This changes
the behavior to correct one.
2020-12-28 13:53:56 +09:00
Takeshi KOMIYA
b19bce971e Merge pull request #8593 from tk0miya/8592_meta_public_doesnt_affect_to_variables
Fix #8592: autodoc: `:meta public:` does not effect to variables
2020-12-28 13:51:50 +09:00
Takeshi KOMIYA
ce52a90d92 Fix #8592: autodoc: :meta public: does not effect to variables
To control the visibility of variables, ModuleDocumenter have to load
docstring of them on `get_object_members()` phase.  This reimplements
it and `get_module_members()` helper to fetch docstring on earlier
phase (as ClassDocumenter does).
2020-12-27 22:21:34 +09:00
Takeshi KOMIYA
c86e92cb95 Fix #8306: autosummary: mocked modules are documented as empty page
The :recursive: option for autosummary directive creates an empty page
for mocked modules unexpectedly.  This make them ignored.
2020-12-27 21:45:15 +09:00
Takeshi KOMIYA
c7d1536828 Close #8132: Add project_copyright confval as an alias of copyright
Avoid to pylint error, add a new config variable; project_copyright
as an alias of `copyright`.
2020-12-27 18:40:06 +09:00
Takeshi KOMIYA
703813a8c1 Fix #8094: texinfo: images on the different directory with document are not copied 2020-12-27 14:51:56 +09:00
Takeshi KOMIYA
9e9e486e65 Close #8022: autodoc: Allow to hide the value of the variables via metadata
autodata and autoattribute directives does not show right-hand value of
the variable if its docstring contains ``:meta hide-value:`` in
info-field-list.
2020-12-27 12:46:03 +09:00
Takeshi KOMIYA
df29440da8 Fix #741: autodoc: inherited-members doesn't support instance attributes on super class
It was fixed once, but it does not work expectedly on running Sphinx
from command line.  It only works fine on test script because
:inherited-members: option is recognized as expected.

This fixes the option_spec handler and autodoc itself.

refs: #8548
2020-12-25 22:37:20 +09:00
Takeshi KOMIYA
b1a47f879b Merge branch '3.4.x' into 3.x 2020-12-25 00:06:41 +09:00
Takeshi KOMIYA
7ae7eab65d Bump version 2020-12-25 00:05:29 +09:00
Takeshi KOMIYA
f5406b9187 Bump to 3.4.1 final 2020-12-25 00:04:05 +09:00
Takeshi KOMIYA
5c39d0c068 Fix #8583: autodoc: Unnecessary object comparision via `__eq__` method
It should be compared by `is` keyword instead.
2020-12-24 23:42:32 +09:00
Takeshi KOMIYA
df8ab215c0 Fix #8566: autodoc-process-docstring is emitted to the alias classes
On the refactoring of Documenter.add_content() method, the
autodoc-process-docstring event is emitted to the alias classes (called
as doc_as_attr in our code) unexpectedly.  Before the change, it has
never been emitted.

The event causes that extensions (ex. numpydoc) confused.  So this
reverts the change temporarily (during 3.4.x).

refs: https://github.com/sphinx-doc/sphinx/pull/8533
2020-12-24 01:34:23 +09:00
Takeshi KOMIYA
4496259bc0 Merge branch '3.4.x' into 3.x 2020-12-23 23:18:06 +09:00
François Freitag
a1b8b1febb Ensure linkcheck items are comparable
Linkcheck organizes the URLs to checks in a PriorityQueue. The items are
tuples (priority, url, docname, lineno).

Tuples where the lineno is `None` are not comparable with tuples that
have an integer lineno, and PriorityQueue items must be comparable (see
https://bugs.python.org/issue31145).

Fixes an issue when a document contains two links to the same URL, one
with an int line number and the other without line number metadata (such
as an image :target: attribute).

Using 0 instead of None to represent no line number should not lead to
observable changes, the result logger only logs the line number when it
is truthy.

Close #8565
2020-12-22 21:18:31 +01:00
Takeshi KOMIYA
70bb2262d6 Fix #8567: autodoc: Instance attributes are incorrectly added to Parent class
The instance attributes on subclasses are shown on the document of
parent class unexpectedly because of autodoc modifies `__annotations__`
in place.  This fix creates a copy of `__annotations__` attribute and
attach it to the subclass.
2020-12-22 02:38:31 +09:00
Takeshi KOMIYA
b3292b55b3 Update CHANGES for PR #8569 2020-12-22 01:14:04 +09:00
Takeshi KOMIYA
423e7ab2ca Fix #8559: AttributeError is raised when using ForwardRef
The restify() helper crashes when ForwardRef is passed.
2020-12-22 00:37:02 +09:00
Takeshi KOMIYA
a7e10c1d36 Bump version 2020-12-20 21:29:23 +09:00
Takeshi KOMIYA
323b136410 Bump version 2020-12-20 21:28:29 +09:00
Takeshi KOMIYA
79ff248154 Bump to 3.4.0 final 2020-12-20 18:55:08 +09:00
Takeshi KOMIYA
61fd867b37 Merged CHANGES for 3.3.2 into 3.4.0 (unreleased) 2020-12-20 18:53:34 +09:00
Takeshi KOMIYA
723294f922 Merge pull request #8556 from tk0miya/8549_gettext_compact=0
Fix #8549: i18n: ``-D gettext_compact=0`` is no longer working
2020-12-20 17:13:10 +09:00
Takeshi KOMIYA
1977f3fcee Fix #8549: i18n: `-D gettext_compact=0` is no longer working
Since 1bf7fe424, ``-D gettext_compact=0`` is not treated as disabling
the feature.  It is recognized as creating ``0.pot`` because its type is
Any.  This changes it to `[bool, str]`.
2020-12-20 13:55:35 +09:00
Takeshi KOMIYA
6e8ea8572f Merge pull request #8552 from tk0miya/8236_napoleon_receives_section
Close #8236: napoleon: Support numpydoc's "Receives" section
2020-12-20 13:54:01 +09:00
Takeshi KOMIYA
2fa15e9396 Merge pull request #8551 from tk0miya/8365_pydomain_xref_missing_context
Fix #8365: py domain: :type: and :rtype: gives false ambiguous warnings
2020-12-20 13:49:53 +09:00
Takeshi KOMIYA
f50b999911 Close #8236: napoleon: Support numpydoc's "Receives" section 2020-12-19 20:29:00 +09:00
Takeshi KOMIYA
30c594fbc5 Fix #8365: py domain: :type: and :rtype: gives false ambiguous warnings
The searching context like py:module and py:class are missing in the
pending_xref nodes generated from info-field-lists.  This sets these
searching context info to them.
2020-12-19 18:42:01 +09:00
Takeshi KOMIYA
c0678a4a50 Fix #741: autodoc: inherited-members doesn't support instance attributes on super class
To support instance attributes on super class, get_class_members() scans
the instance attributes defined at super classes using ModuleAnalyzer.
It allows to generate document for them when users gives :
inherited-members: option.
2020-12-18 23:24:59 +09:00
Takeshi KOMIYA
9721327989 Fix #8545: autodoc: a __slots__ attribute is not documented even having docstring
To avoid filtering __slots__ attributes having docstring at
filter_members(), this passes docstring captured at get_class_members()
to the filter_members() via ObjectMember.
2020-12-17 22:19:28 +09:00
Takeshi KOMIYA
559f01df5b Update CHANGES for PR #8542 2020-12-17 22:03:38 +09:00
Takeshi KOMIYA
55c110f609 Fix #8541: autodoc_type_aliases doesn't work for the instance attrs
So far, autodoc obtains type annotations of instance attributes by
ModuleAnalyzer directly.  As a result, autodoc_type_aliases are ignored
for these variables.

This goes to merge type annotations from the class itself and
ModuleAnalyzer's, and get type annotations using `typing.get_type_hints()`
to apply autodoc_type_aliases.
2020-12-17 01:07:54 +09:00
Takeshi KOMIYA
36e684bf83 refactor: Move _getmro() to sphinx.util.inspect module 2020-12-17 00:46:42 +09:00
Takeshi KOMIYA
caa1d1f3c2 Fix #8534: autoattribute failed to document a commented attribute in alias class
So far, autoattribute uses "given class name" to fetch comments of
uninitialized instance attributes.  But pycode expects to use "real"
class name on searching attribute comments.

This adds UninitializedInstanceAttributeMixin to handle it simply.
2020-12-16 02:43:31 +09:00
Takeshi KOMIYA
00db1ea631 Merge pull request #8538 from jdufresne/os-replace
Deprecate sphinx.util.osutil.movefile() in favor of os.replace()
2020-12-14 23:43:00 +09:00
Takeshi KOMIYA
edb1999ac2 Update CHANGES for PR #8524 2020-12-14 23:40:28 +09:00
Jon Dufresne
cb4f76fca2 Deprecate sphinx.util.osutil.movefile() in favor of os.replace()
The utility function movefile() was added in
677d096393 to handle existing files on
Windows. Since Python 3.3, the stdlib function os.replace() fills this
role.
2020-12-13 09:36:10 -08:00
Takeshi KOMIYA
399210c807 Merge pull request #8533 from tk0miya/deprecate_no_docstring
refactor: Deprecate `no_docstring` argument for Documenter.add_content()
2020-12-14 01:32:42 +09:00
Takeshi KOMIYA
3638a9e4d1 refactor: Deprecate no_docstring argument for Documenter.add_content()
This deprecates `no_docstring` argument for Documenter.add_content().
After this change, please use Documenter.get_doc() to control (suppress)
the content of the python object.
2020-12-13 02:11:53 +09:00
Jakob Lykke Andersen
c777a90816 Merge pull request #8530 from jakobandersen/bnavigator-fix-AliasNode-copy
C, fix AliasNode.copy
2020-12-12 17:47:08 +01:00
Jakob Lykke Andersen
43113594aa Update CHANGES 2020-12-12 17:27:47 +01:00
Takeshi KOMIYA
8faa8ba7ab Update CHANGES for PR #8523 2020-12-12 15:16:51 +09:00