sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.41k stars 2.09k forks source link

[tracker] Issues related to autodoc and "undefined reference" #11991

Open picnixz opened 6 months ago

picnixz commented 6 months ago

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 imports

Forward References and from __future__ import annotations

Type variables and new types treated as data instead of class

None and Optional not linking correctly:

Using optional as keyword misidentified as type:

Literal types not linking correctly:

Returns section types not linking:

Yield section types not linking correctly:

Generic types not linking:

@dataclass specific linking bugs:

@property return type:

General alias linking problems:

Napoleon specific:

Docstring extraction

Miscellaneous

Under consideration (Python 3.9 failure only)

Tasks issues

Possible solutions

For people that want some solutions:

electric-coder commented 6 months ago

These are the issue I could find that relate to types not linking correctly where the cause is plain processing of annotations in signatures or docstrings.

None and Optional not linking correctly:

Using optional as keyword misidentified as type:

Literal types not linking correctly:

Returns section types not linking:

Yield section types not linking correctly:

Generic types not linking:

Alias of generic and parameterized types:

TypeVar not linking:

TYPE_CHECKING specific:

@dataclass specific linking bugs:

@property return type:

(maybe a regression of the older - #8004)

autodoc mixing up data types:

this issue is somewhat of a miscellaneous:

General alias linking problems:

Napoleon specific:

picnixz commented 6 months ago

Thank you for what you found. I'll update my issue tomorrow.

EDIT: I've included your issues in mine so I'll hide your comment. Thank you!