sphinx-autoapi icon indicating copy to clipboard operation
sphinx-autoapi copied to clipboard

autoapifunction, autoapiclass and autoapimethod do not render returntype in the signature.

Open Josverl opened this issue 6 months ago • 0 comments

I wish to use autoapi to :

  • generate documentation for a set of .pyi stub files
  • add manual How To & Why documentation pages using autodoc style directives

I notice that all return types are absent when using autodocstyle directives and specifying autodoc_typehints = "signature" for the same functions and classes the return types correctly documented by both autodoc and api_docs

Stranger still is that if I set autodoc_typehints = "both", the return type can be shown below the docstring. However I'd much prefer to use the 'signature stlye'

autoapi_autodoc style autodoc* autoapi api_docs
autodoc_typehints = "signature" ditto
image image image
autodoc_typehints = "both" ditto
image image

Notes: The .pyi has been renamed to .py to enable plain autodoc. foo and foo_2 are identical

Is this a bug, or am I missing a configuration / value ?   Repro can be found : https://github.com/Josverl/repro-autoapi-return-annotation

Josverl avatar Aug 06 '24 19:08 Josverl