Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docstrings for primitive type aliases are ignored #9866

Closed
cimes-isi opened this issue Nov 18, 2021 · 0 comments
Closed

Docstrings for primitive type aliases are ignored #9866

cimes-isi opened this issue Nov 18, 2021 · 0 comments

Comments

@cimes-isi
Copy link

Describe the bug

When documenting type aliases, the docstrings for primitive types are incorrectly ignored, but the docstrings for non-primitive types (e.g., Unions) are being correctly captured.

How to Reproduce

$ git clone https://github.com/cimes-isi/sphinx-type-alias-doc-bug.git
$ cd sphinx-type-alias-doc-bug
$ pip install sphinx
$ cd docs
$ make html

Open docs/build/html/testmod.html and see that the docstrings are not captured for testmod.FieldInt and testmod.FieldInt2.

Expected behavior

The docstrings should be included in the generated documentation.

Your project

https://github.com/cimes-isi/sphinx-type-alias-doc-bug

Screenshots

sphinx-docstrings-missing

OS

MacOS Big Sur

Python version

3.8.2

Sphinx version

4.3.0

Sphinx extensions

sphinx.ext.autodoc

Extra tools

No response

Additional context

No response

@tk0miya tk0miya added this to the 4.4.0 milestone Nov 18, 2021
tk0miya added a commit to tk0miya/sphinx that referenced this issue Nov 21, 2021
…nored

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.
tk0miya added a commit to tk0miya/sphinx that referenced this issue Nov 21, 2021
…nored

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.
tk0miya added a commit that referenced this issue Nov 22, 2021
…sses

Fix #9866: autodoc: doccoment for the imported class was ignored
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants