sphinx-doc / sphinx-doc/sphinx
autosummary doesn't document annotated attributes with no default values
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
For the following code, A.a won't be documented by autosummary:
class A:
"A's doc"
a: int
"Doc"
To Reproduce
Steps to reproduce the behavior:
-
Download bug.tar.gz and unarchive it.
-
Run
PYTHONPATH=. sphinx-build -d "./_build" docs "_build/html" -b html -W --color
.
├── docs
│ ├── conf.py
│ └── index.rst
└── myproject.py
myproject.py defines class A as above. index.rst shows:
Welcome to myproject's documentation!
=====================================
.. currentmodule:: myproject
.. autosummary::
:toctree:
A
conf.py is minimal:
project = 'myproject'
copyright = '2020, someone'
author = 'someone'
extensions = [
'sphinx.ext.autosummary'
]
html_theme = 'alabaster'
autosummary_generate = True
Expected behavior
A.a being documented.
Environment info
- OS: Debian 10
- Python version: 3.7.3
- Sphinx version: 3.4.1
- Sphinx extensions: autosummary
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by downloading and unpacking bug.tar.gz, then run the reported sphinx-build command against docs with warnings treated as errors. Trace how the autosummary entry for A is generated from myproject.py, and verify completion when the generated documentation includes A.a for the annotated attribute without a default value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100