.. autofunction:: example.my_function
Created
March 2, 2026 00:14
-
-
Save JWCook/c67ee45c54632f978df1d40951606ee0 to your computer and use it in GitHub Desktop.
sphinx-autodoc-typehint bug reproducer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| from pathlib import Path | |
| sys.path.insert(0, str(Path(__file__).parent.parent)) | |
| extensions = [ | |
| "sphinx.ext.autodoc", | |
| "sphinx.ext.intersphinx", | |
| "sphinx_autodoc_typehints", | |
| ] | |
| intersphinx_mapping = { | |
| "python": ("https://docs.python.org/3", None), | |
| } | |
| project = "repro" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import Any | |
| def my_function(data: dict[str, Any]) -> dict[str, Any]: | |
| """Example function. | |
| Args: | |
| data: Some data. | |
| """ | |
| return data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [build-system] | |
| requires = ["setuptools"] | |
| build-backend = "setuptools.build_meta" | |
| [project] | |
| name = "repro" | |
| version = "0.1.0" | |
| requires-python = ">=3.12" | |
| dependencies = [ | |
| "sphinx~=9.1", | |
| "sphinx-autodoc-typehints==3.9.2", | |
| ] | |
| [tool.setuptools.packages.find] | |
| where = ["."] | |
| include = ["example*"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment