You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue serves as a tracker for issues related to autodoc and its inhability to render types. Feel free to dump the issues you find relevant and I'll add them to this tracker. That way, people can easily find them and we can also find what is missing or not.
Consider using autodoc_type_aliases (the support is limited and does not work for missing references in class signatures for instance).
Ignore the warnings by specifying entries in nitpick_ignore (it does not solve everything but at least you know what is wrong). Be careful though since sometimes names are incorrectly resolved because they are thought to be the same... (e.g., importing docutils.nodes.Node and _pytest.nodes.Node as Node and using Node in an annotation uses the first reference it finds if Node is not available at runtime, e.g., guarded in a TYPE_CHECKING block).
This issue serves as a tracker for issues related to autodoc and its inhability to render types. Feel free to dump the issues you find relevant and I'll add them to this tracker. That way, people can easily find them and we can also find what is missing or not.
TYPE_CHECKING
guarded importsif TYPE_CHECKING
imports #11225Forward References and
from __future__ import annotations
Type variables and new types treated as
data
instead ofclass
NewType
instances to be data, but autodoc considers them a class #11552None
andOptional
not linking correctly:None
is no longer hyperlinked after 4.4.0 #10899Using optional as keyword misidentified as type:
Literal
types not linking correctly:autodoc_type_aliases
not working withtyping.Literal
type aliases... #10525Returns
section types not linking:Yield
section types not linking correctly:Generic types not linking:
@dataclass
specific linking bugs:@property
return type:autodoc-process-signature
does not populate return signature for properties #10396General alias linking problems:
default_role
aware of aliases. #9453Napoleon specific:
Docstring extraction
str
#12020Miscellaneous
Return type
sections to be generated in autoclass #12472Under consideration (Python 3.9 failure only)
Tasks issues
autodoc_type_aliases
#11687ModuleAnalyzer
#11688Possible solutions
For people that want some solutions:
autodoc_type_aliases
(the support is limited and does not work for missing references in class signatures for instance).nitpick_ignore
(it does not solve everything but at least you know what is wrong). Be careful though since sometimes names are incorrectly resolved because they are thought to be the same... (e.g., importingdocutils.nodes.Node
and_pytest.nodes.Node
asNode
and usingNode
in an annotation uses the first reference it finds ifNode
is not available at runtime, e.g., guarded in a TYPE_CHECKING block).The text was updated successfully, but these errors were encountered: