Commit Graph
16308 Commits
Author SHA1 Message Date
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 7f1284f2e7 Merge pull request #8555 from tk0miya/8512_test_comment
test: Add comment for UnicodeEncodeError handler (refs: #8512)
2020-12-20 13:53:24 +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 9a9d7f3f00 test: Add comment for UnicodeEncodeError handler (refs: #8512) 2020-12-20 01:01:59 +09:00
Takeshi KOMIYA aae2f19911 Merge pull request #8512 from jbms/fix-nonascii_srcdir
Fix nonascii_srcdir to work when non-ascii directories aren't supported
2020-12-20 00:58:08 +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 57ed10c680 Merge pull request #8548 from tk0miya/741_inherited_ivar
Fix #741: autodoc: inherited-members doesn't support instance attributes on super class
2020-12-19 00:31:03 +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 dd1615c59d Merge pull request #8543 from tk0miya/8534_autoattribute_alias_derived
Fix #8534: autoattribute failed to document a commented attribute in alias dervied class
2020-12-17 22:35:35 +09:00
Takeshi KOMIYA e3dc782364 Merge pull request #8546 from tk0miya/8545_slots_attributes_having_docstring
Fix #8545: autodoc: a __slots__ attribute is not documented even having docstring
2020-12-17 22:34:58 +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 964392d316 refactor: get_class_members() now returns docstring if available
To detect a __slots__ attribute has docstring, get_class_members()
returns the docstring of the class member.
2020-12-17 22:19:27 +09:00
Takeshi KOMIYA 18973f6c1b refactor: autodoc: Add get_class_members()
To enhance ClassDocumenter, Add a new helper function get_class_members().
At this moment, it is a copy of get_object_members().  It will be
changed to return more detailed information of class members.
2020-12-17 22:19:12 +09:00
Takeshi KOMIYA 0dbbf1dd54 Fix #8534: autoattribute failed to document a commented attribute in alias dervied class 2020-12-17 22:13:20 +09:00
Takeshi KOMIYA beeab6ced4 Merge pull request #8542 from tk0miya/8541_autodoc_type_aliases_for_ivar
Fix #8541: autodoc_type_aliases doesn't work for the instance attrs
2020-12-17 22:12:06 +09:00
Takeshi KOMIYA 559f01df5b Update CHANGES for PR #8542 2020-12-17 22:03:38 +09:00
Takeshi KOMIYA 385f9f5c19 refactor: autodoc: minor fix 2020-12-17 21:59:09 +09:00
Takeshi KOMIYA 17a32d963a Merge pull request #8544 from Julian/patch-1
Minor typo in the contributing info
2020-12-17 03:45:05 +09:00
Julian Berman b96d228735 Minor typo in the contributing info 2020-12-16 12:09:17 -05: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 bec552c3ef Merge pull request #8540 from tk0miya/8534_autoattribute_alias
Fix #8534: autoattribute failed to document a commented attribute in alias class
2020-12-16 23:47:21 +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 3e46fda759 refactor: autodoc: Add NonDataDescriptorMixin 2020-12-16 02:36:34 +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
Takeshi KOMIYA 18b7202627 Merge pull request #8524 from rkdarst/rkdarst/template-document-options-url_root
sphinx/themes/basic/layout: Set url_root properly on index, don't use '#'
2020-12-14 23:36:29 +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
Richard Darst 21aecb14a7 sphinx/themes/basic/layout: Set url_root properly on index, don't use '#'
- url_root is set to `#` on the index page, which layout.html tries to
  change back to `''` (the empty string).
- But, this updated url_root wasn't used in the actual location, as an
  argument to `documentation_options.js`.
- Thus, clever enough templates, which tried to use
  `$DOCUMENTATION_OPTIONS.URL_ROOT` inside javascript would fail.
  This was manifested as broken links, which led to this issue:
  https://github.com/executablebooks/sphinx-copybutton/issues/110
- I have eventually traced that back to sphinx itself, and found that
  layout.html tried to fix the problem, but the fixed value wasn't
  used.
- This fix works in my basic test, but I will continue with more tests.
- Review:
  - someone more clever should examine this and make sure it makes
    sense
  - This does not have tests.  Should it?
2020-12-13 19:12:07 +02:00
Takeshi KOMIYA 5b28d77b37 Merge branch '3.3.x' into 3.x 2020-12-14 01:49:17 +09:00
Takeshi KOMIYA 8ed1e706cc Merge pull request #8527 from tk0miya/8111_pretty_change
refactor: pretty change for isproperty()
2020-12-14 01:33:01 +09: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 368c223f08 Merge pull request #8535 from nedbat/nedbat/more-about-intersphinx
Describe the intersphinx mapping a bit more
2020-12-13 22:41:25 +09:00
Ned Batchelder bac6ab8d0c Describe the intersphinx mapping a bit more 2020-12-13 08:04:55 -05:00
Jakob Lykke Andersen 3a85c005a7 Merge pull request #8531 from jakobandersen/bnavigator-fix-AliasNode-copy
C, fix AliasNode.copy, correct branch
2020-12-12 18:53:46 +01: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
Jakob Lykke Andersen b7c7adfd18 C++, typing on AliasNode.copy 2020-12-12 17:26:27 +01:00
Ben Greiner e35639299d Fix mypy type error 2020-12-12 17:24:25 +01:00
Ben Greiner 61556e3410 Fix AliasNode.copy() 2020-12-12 17:24:25 +01:00
Takeshi KOMIYA 8823d1c528 Merge pull request #8528 from jdufresne/drop-workaround
Drop outdated workaround for distutils' Command._ensure_stringlike()
2020-12-13 00:11:15 +09:00
Takeshi KOMIYA d5e13324e8 Merge pull request #8529 from jdufresne/dup-test
Remove duplicate test in test_ext_autodoc.py
2020-12-12 23:55:10 +09:00
Jon Dufresne 850512090a Remove duplicate test in test_ext_autodoc.py
Duplicate since c6bd84a614.
2020-12-12 06:28:23 -08:00
Jon Dufresne 0938bdb2a8 Drop outdated workaround for distutils' Command._ensure_stringlike()
The issue applied to Python 2 only. The current override is identical to
the CPython implementation:

https://github.com/python/cpython/blob/4b8cdfcb22fbeaab9d954cb693a7fb3362a382b6/Lib/distutils/cmd.py#L207-L215
2020-12-12 06:17:59 -08:00
Takeshi KOMIYA e15f7a1f02 refactor: pretty change for isproperty()
It is more readable to use `>=` to compare versions.
2020-12-12 18:54:53 +09:00