sphinx-autodoc-typehints icon indicating copy to clipboard operation
sphinx-autodoc-typehints copied to clipboard

_parser.parse() causes issues if directives with side-effects are active

Open marten-de-vries opened this issue 11 months ago • 0 comments

sphinx-autodoc-typehints will cause a docstring to be processed twice: once by its own _parser module, and once by sphinx.ext.autodoc. This is a problem when directives that have (non-idempotent) side-effects are used.

I ran into this while combining this extension with Sphinx-Needs. The side-effect in that case is that Sphinx-Needs extracts an identifier from the directive block, and verifies the identifier is unique across the project. That's not the case if the identifier is processed twice. As this bug is caused by an interaction of extensions I've opened an issue in the Sphinx-Needs repo as well.

marten-de-vries avatar Dec 16 '24 11:12 marten-de-vries