Open g3n35i5 opened 5 months ago
PR with a fix is welcome (with tests). Thanks!
Similarly, adding any sort of replacement in conf.py
rst_prolog = """
.. |pyngrok_version| replace:: {pyngrok_version}
""".format(pyngrok_version=version)
replaces every typedoc hint, whether it matches the replacement string or not (in this case, version
is 7.1.5
):
Presumably it's finding the union |
operator too greedily. Here's how the docs should look: https://pyngrok.readthedocs.io/en/latest/api.html#module-pyngrok.ngrok
Solution until this is fixed is to pin back the version:
sphinx_autodoc_typehints==1.25.2
@flying-sheep can you take a look at this regression?
Should be simple: https://github.com/tox-dev/sphinx-autodoc-typehints/pull/436
The RSTParser
class we use has a dedicated method to add pro- and epilogue. We can just replace that with something that does nothing.
You just need to add a test and it should be ready to go.
Since https://github.com/tox-dev/sphinx-autodoc-typehints/pull/422/ has been merged , the function documentation contains the
rst_prolog
option text.The
rst_prolog
option is automatically inserted at the beginning of each source file read. I currently use it to globally limit the toc tree depth.With the changes in https://github.com/tox-dev/sphinx-autodoc-typehints/pull/422/, the documentation of the individual functions is written to temporary rst files and then evaluated, as far as I understand it. This ensures that sphinx inserts the rst_prolog value and
sphinx-autodoc-typehints
seems to interpret this value not as an rst directive but as a string.