sphinx-doc / sphinx-doc/sphinx
`autodoc-process-signature` does not populate return signature for properties
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
The signature and return_annotation arguments from the autodoc-process-signature callback is always None and None for properties. The return_annotation should be populated with the property return type.
How to Reproduce
Unzip sphinx-bug.zip and cd into its folder.
$ sphinx-build -b html -v docs/ docs/build/
Expected behavior
Current Sphinx build output
...
reading sources... [100%] index
class my_module.MyClass <class 'my_module.MyClass'> (arg1: str) None
method my_module.MyClass.my_classmethod <bound method MyClass.my_classmethod of <class 'my_module.MyClass'>> (b: int) str
method my_module.MyClass.my_method <function MyClass.my_method at 0x7fb668d558b0> (a: int) int
property my_module.MyClass.my_property <property object at 0x7fb668d4b040> None None
...
Expect Sphinx build output
...
reading sources... [100%] index
class my_module.MyClass <class 'my_module.MyClass'> (arg1: str) None
method my_module.MyClass.my_classmethod <bound method MyClass.my_classmethod of <class 'my_module.MyClass'>> (b: int) str
method my_module.MyClass.my_method <function MyClass.my_method at 0x7fb668d558b0> (a: int) int
property my_module.MyClass.my_property <property object at 0x7fb668d4b040> None str
...
Your project
Attached above
Screenshots

OS
Ubuntu 20.04 in WSL
Python version
3.8.10
Sphinx version
4.5.0
Sphinx extensions
sphinx.ext.autodoc
Extra tools
No response
Additional context
No response
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 with the sphinx.ext.autodoc handling of the autodoc-process-signature callback and reproduce the behavior with the attached project using sphinx-build -b html -v docs/ docs/build/. Done means property callbacks receive the property's return type in return_annotation instead of None, matching the expected output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100