Commit Graph

16358 Commits

Author SHA1 Message Date
Hong Xu
6927130ff1
Doc: Correct type: "TypeAlias" -> "AliasType" 2020-12-27 21:23:31 -08: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
556b9743fe
Merge pull request #8596 from tk0miya/8022_meta_hide_value
Close #8022: autodoc: Allow to hide the value of the variables via metadata
2020-12-28 12:15:56 +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
07983a5a87
Merge pull request #8589 from tk0miya/8581_deprecate_no_docstrings
refactor: Deprecate `no_docstring` argument for Documenter.add_content()
2020-12-27 22:19:30 +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
bcebe71c8e refactor: autodoc: Add DataDocumenter.get_module_comment()
Similar to AttributeDocumenter.get_attribute_comment(), add a helper
method DataDocumenter.get_module_comment()
2020-12-27 12:25:08 +09:00
Takeshi KOMIYA
4fc93ac13c
Merge pull request #8590 from tk0miya/7875_note_object
Fix #7875: doc: Add PythonDomain.note_object()
2020-12-27 11:55:06 +09:00
Takeshi KOMIYA
057a9e444d
Merge pull request #8587 from tk0miya/741_inherited_instance_attributes
Fix #741: autodoc: inherited-members doesn't support instance attributes on super class
2020-12-27 11:52:23 +09:00
Takeshi KOMIYA
6c645e41f8 refactor: Deprecate no_docstring argument for Documenter.add_content()
Deprecate `no_docstring` argument for `Documenter.add_content()` again.

At the first trial (#8533), it changes the behavior of
`autodoc-process-docstring` event; it is emitted unexpectedly for an
alias of class.  But it brings an incompatible change to extensions.
Hence it was partially reverted at #8581.

This keeps not calling the event for an alias of class.  To do that,
now `Documenter.get_doc()` can return None value.
2020-12-26 21:14:26 +09:00
Takeshi KOMIYA
140ef33469 Fix #7875: doc: Add PythonDomain.note_object() 2020-12-26 21:12:15 +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
ada4f38ad8
Merge pull request #8558 from tk0miya/add_UninitializedInstanceAttributeMixin
refactor: Add UninitializedInstanceAttributeMixin
2020-12-25 00:11:25 +09:00
Takeshi KOMIYA
02006e665c
Merge pull request #8563 from tk0miya/refactor_get_attribute_comment
refactor: autodoc: Move get_attribute_comment() to AttributeDocumenter
2020-12-25 00:10:14 +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
5ba725724d refactor: Add UninitializedInstanceAttributeMixin
Add a new mix-in for uninitialized instance attributes that is defined
with annotation but not initialized (based on PEP-526).
2020-12-25 00:00:52 +09:00
Takeshi KOMIYA
022bbb92a1 refactor: autodoc: Move get_attribute_comment() to AttributeDocumenter
To share the implementation to every attributes-mixins, this moves
get_attribute_comment() method to AttributeDocumenter.
2020-12-24 23:59:45 +09:00
Takeshi KOMIYA
b94752a293
Merge pull request #8585 from tk0miya/8583_unnecessary_eq
Fix #8583: autodoc: Unnecessary object comparision via ``__eq__`` method
2020-12-24 23:55:44 +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
043260481b
Merge pull request #8581 from tk0miya/8566_autodoc_process_docstring_for_alias_classes
Fix #8566: autodoc-process-docstring is emitted to the alias classes
2020-12-24 23:35:01 +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
a18fee24f2
Merge pull request #8572 from mitya57/fix-hebrew-in-test
Fix name of the Hebrew language in test_create_single_index
2020-12-23 23:18:54 +09:00
Takeshi KOMIYA
4496259bc0 Merge branch '3.4.x' into 3.x 2020-12-23 23:18:06 +09:00
Takeshi KOMIYA
bb768003ab
Merge pull request #8576 from farisachugthai/patch-2
Update PULL_REQUEST_TEMPLATE.md
2020-12-23 22:44:22 +09:00
Takeshi KOMIYA
46eaa5db80
Merge pull request #8579 from francoisfreitag/fix-queue
Ensure linkcheck items are comparable
2020-12-23 22:43:11 +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
955d6558ec
Merge pull request #8571 from tk0miya/8567_wrong_ivars_in_parent_class
Fix #8567: autodoc: Instance attributes are incorrectly added to Parent class
2020-12-22 23:40:25 +09:00
Faris A Chugthai
2e5b3911fe
Update PULL_REQUEST_TEMPLATE.md
The branch model URL doesn't seem to be at the development page anymore. Update the pull request template.
2020-12-21 22:51:49 -05:00
Takeshi KOMIYA
da9ee49508
Merge pull request #8561 from tk0miya/refactor_UninitializedInstanceAttributeMixin
Refactor UninitializedInstanceAttributeMixin
2020-12-22 02:39:11 +09: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
0d943d8d49
Merge branch '3.x' into refactor_UninitializedInstanceAttributeMixin 2020-12-22 02:30:35 +09:00
Takeshi KOMIYA
067402c69b
Merge pull request #8560 from tk0miya/refactor_UninitializedGlobalVariableMixin
Refactor UninitializedGlobalVariableMixin
2020-12-22 02:29:29 +09:00
Takeshi KOMIYA
4e70b5e2f1
Merge pull request #8557 from tk0miya/RuntimeInstanceAttributeDocumenter
refactor: Rename UninitializedInstanceAttributeMixin
2020-12-22 02:28:16 +09:00
Dmitry Shachnev
5b779b4201 Fix name of the Hebrew language in test_create_single_index 2020-12-21 20:12:34 +03:00
Takeshi KOMIYA
31cad2ebe7
Merge pull request #8570 from tk0miya/8569_getslots_TypeError
Fixes #8568. Ignore TypeError from getslots in isslotsattribute
2020-12-22 01:24:24 +09:00
Takeshi KOMIYA
b3292b55b3 Update CHANGES for PR #8569 2020-12-22 01:14:04 +09:00
Takeshi KOMIYA
22080940e2 doc: Update docstring of getslots() 2020-12-22 00:53:27 +09:00
Rafal Wojdyla
4431f11876 Fixes #8568. Ignore TypeError from getslots in isslotsattribute 2020-12-22 00:52:52 +09:00
Takeshi KOMIYA
97a0babd46
Merge pull request #8564 from tk0miya/8559_AttributeError_for_ForwardRef
Fix #8559: AttributeError is raised when using ForwardRef
2020-12-22 00:50:22 +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
990396dd2c autodoc: Enable mocks on importing module 2020-12-21 02:17:23 +09:00
Takeshi KOMIYA
0f0560f07b refactor: autodoc: Use importer.import_module() 2020-12-21 02:04:17 +09:00
Takeshi KOMIYA
edc7f23620 autodoc: Fix enable mocks on importing module 2020-12-21 01:32:50 +09:00
Takeshi KOMIYA
d7c490fefc refactor: autodoc: Do not fill parent field when not global variable 2020-12-21 01:20:58 +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
ccb9a3e635 refactor: Rename UninitializedInstanceAttributeMixin
The instance variables defined at __init__() method are basically
initialized.  So it's not appropriate to call them as "uninitialized".
So this renames the documenter for them to
RuntimeInstanceAttributeMixin.
2020-12-20 19:35:05 +09:00
Takeshi KOMIYA
79ff248154 Bump to 3.4.0 final 2020-12-20 18:55:08 +09:00