Skip to content

Instantly share code, notes, and snippets.

@JWCook
Created March 2, 2026 00:14
Show Gist options
  • Select an option

  • Save JWCook/c67ee45c54632f978df1d40951606ee0 to your computer and use it in GitHub Desktop.

Select an option

Save JWCook/c67ee45c54632f978df1d40951606ee0 to your computer and use it in GitHub Desktop.
sphinx-autodoc-typehint bug reproducer
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"
from typing import Any
def my_function(data: dict[str, Any]) -> dict[str, Any]:
"""Example function.
Args:
data: Some data.
"""
return data

example

.. autofunction:: example.my_function
[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