Autodoc tried to scan doccomment on the module where the class defined.
But it failed to get it if the class is imported from other module.
This analyzes the target module to obtain the doccomment.
In case of the descendants of generic class, the value of
obj.__orig_bases__ is incorrect because it returns original base
arguments for the child of the generic class instead of the target
class itself.
This uses obj.__dict__ to get the correct __orig_bases__ information.
Autodoc generates reST code that uses raw `:obj:` and `:class:` xrefs to
refer the classes and types. But they're fragile because they assume
the primary_domain=='py'.
This adds `:py:` prefix to these xrefs to make them robust.
Add `autodoc-process-bases` to modify the base classes of the class
definitions. This allows the extensions to insert or modify the list
of the base classes via event-handlers.
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`.
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.
Unintentionally, uninitialized attributes defined at superclasses are
recognized as undocumented in the filtering step. Therefore, they are
filtered if `:undoc-members:` option given.
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.
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.
To avoid filtering __slots__ attributes having docstring at
filter_members(), this passes docstring captured at get_class_members()
to the filter_members() via ObjectMember.
Keep imports alphabetically sorted and their order homogeneous across
Python source files.
The isort project has more feature and is more active than the
flake8-import-order plugin.
Most issues caught were simply import ordering from the same module.
Where imports were purposefully placed out of order, tag with
isort:skip.
In #7651, autodoc stops to undecorate the functions on getting the
signature from the callables. But some kinds of decorators conceals
the correct signature because they pass through their arguments via
`(*args, **kwargs)`.
This restarts to undecorate the functions again as before #7651.