sphinx-doc / sphinx

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

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

Open picnixz opened 9 months ago

picnixz commented 9 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 9 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 8 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!

electric-coder commented 1 month ago

10793 should be added to the list under the "None and Optional not linking correctly".

The issue was tagged as extensions:intersphinx but should be retaged as extensions:autodoc.

This has been reported several times but I couldn't find an "exact" duplicate as comparable posts also conflate other issues.