The special members are not treated as "attributes". So they're not
handled by DataDocumenter. This moves the detection to the earlier
step of filter_members().
When multiple singledispatch decorators are stacked, the first typehints
are copied to the subsequent definitions unexpectedly.
Now autodoc generates a dummy function not to affect typehints to
subsequent functions.
Add `class-doc-from` option to the `autoclass` directive to control
the content of the specific class. It takes `class`, `init`, and `both`
like `autoclass_content`.
There is no docs and testcases for "None" argument of the program
directive. It has been implemented since very old version. But it's
not documented and tested long.
A duplicated warning is emitted when both canonical and its alias
objects are defined on the same document. But it should not be emitted
because they're the same object, not conflicted.
On generating the base class information, unexpected nit-picky warning
for ``typing.Any`` was emitted. This fixes it by using `~` prefix on
generating a cross-reference to make it valid.
The imgconverter unexpectedly goes to convert even if the given image
is supported by the target builder when the image globbing is not used.
This enables format guess-ing on not globbed.
On parsing the types, the leading dot of the ellipsis (...) is considered
as a reference name. And its first dot is considered as a notation for
relative type reference (ex. ".ClassName"). As a result, it was converted
double dots unexpectedly.
This changes the parsing rule to treat the ellipsis as a symbol, not a
name.
Add test objects so all builders gets exposed to the new nodes.
Make the fallback node post-transform change desc_inline as well.
Make the html4, latex, and text writers handle desc_inline.
Since v0.17, docutils starts to load language module on parsing reST
document using StateMachine directly. So far, our testcase uses invalid
language code for testing autosummary. This fixes it to work with new
docutils.
Since v0.17, docutils starts to use <figure> and <figcaption> for figure
and its caption on HTML output. This modifies the expected value of our
testcases to support it.
Add new tests to exercise the new autodoc_typehint_undoc option. Where
an existing test would have a meaningful behavior change with the new
option set to False, that test is copied, the new option is set to False
in the copy, and the assertions reflect the new expected behavior.
The new test test_autodoc_typehints_description_with_documented_init
illustrates the problem reported in #7329, and the new test
test_autodoc_typehints_description_with_documented_init_no_undoc
illustrates that this issue no longer occurs when the new
autodoc_typehint_undoc option is set to False.
This generates `:canonical:` option for `:py:class:` directive if the
target class is imported from other module. It allows users to refer it
using both the new name (imported name) and the original name (canonical
name).
It helps a library that implements some class in private module (like
`_io.StringIO`), and publish it as public module (like `io.StringIO`).
DocumenterBridge.filename_set has been used since its beginning. On the
other hand, in docutils, record_dependencies attribute is well-used to
store the list of dependency files. So this renames it to docutils'
standard attribute.
To make directives' behavior consistent, the :file: option for
csv-table directive now recognizes an absolute path as a relative
path from source directory.
Add a new extension `sphinx.ext.autodoc.preserve_defaults`.
It preserves the default argument values of function signatures in source code
and keep them not evaluated for readability. This is an experimental
extension and it will be integrated into autodoc core in Sphinx-4.0.
Add a new config variable: python_use_unqualified_type_names. If enabled,
it goes to suppress the module name of the python reference if it can be
resolved.
To describe the purpose more accurately, the `master_doc` is now renamed
to `root_doc`. The old name is still available. But it is recommeneded
to use new one from now on.
So far, a TypeVar is rendered without module name. As a result, it
could not be resolved if it is imported from other modules. This
prepends its module name and make it resolvable. This is available
only in Python 3.7 or above.
As a side effect, all of TypeVars are displayed with module name. It
should be fixed in latter step (refs: #7119)
Resolved Conflicts:
sphinx/texinputs/sphinx.sty
Some hunks needed to go to sphinx/texinputs/sphinxlatexliterals.py,
others already belonged to split files.
To achieve this the simplest was to use also the \label/\ref mechanism
as for footnotes typeset using footnotetext. Removing the hack into
footnotehyper internal macro, we use an enriched scope, which will
enable references with same number to each generate correct links.
The type union operator (PEP-604) causes autodoc crashed in python 3.9
or below because of the syntax is not suppoerted yet in the interpreters.
Internally, `typing.get_type_hints()` raises TypeError on evaluating the
annotation by BitOr operator for types.
To avoid the crash, this adds a fallback not to evaluate the annotations
and keep as is. As a side effect, `autodoc_type_aliases` will not work
for the modules and classes that uses type union operator for their
annotations.
Unintentionally, uninitialized attributes defined at superclasses are
recognized as undocumented in the filtering step. Therefore, they are
filtered if `:undoc-members:` option given.