Skip to main content

Cross-referenced type annotations for Sphinx autodoc

Project description

sphinx-autodoc-typehints-gp

Single-package replacement for sphinx-autodoc-typehints and sphinx.ext.napoleon — resolves annotations statically at build time, no monkey-patching required.

Part of the gp-sphinx shared autodoc stack: annotation normalization, cross-referenced type links, and TYPE_CHECKING-safe resolution all live here.

Install

$ pip install sphinx-autodoc-typehints-gp

Usage

extensions = ["sphinx.ext.autodoc", "sphinx_autodoc_typehints_gp"]

# Required: makes autodoc insert type annotations into parameter descriptions.
# Without this, the type cross-referencing pipeline fires but has nothing to attach to.
autodoc_typehints = "description"

Features

  • Resolves type hints statically via AST — no exec(), no typing.get_type_hints().
  • Handles TYPE_CHECKING blocks correctly (import-time guards are not evaluated).
  • No text-processing races with sphinx.ext.napoleon.
  • Shared annotation normalization and rendering helpers for the sphinx-autodoc-* family.

Documentation

See the full documentation for the API reference, helper functions, and the static resolution comparison table.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_autodoc_typehints_gp-0.0.1a11.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_autodoc_typehints_gp-0.0.1a11-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_autodoc_typehints_gp-0.0.1a11.tar.gz.

File metadata

File hashes

Hashes for sphinx_autodoc_typehints_gp-0.0.1a11.tar.gz
Algorithm Hash digest
SHA256 63a7196197f14183641a15566d707bd2ae44626eee11ec8c9188b4ee2ea7f622
MD5 1f2ee21d8def4b738db4fadd162925f2
BLAKE2b-256 39994629060676c3a3e8135270e59bcb327aefe1fe37b37e177012e2211a47ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_autodoc_typehints_gp-0.0.1a11.tar.gz:

Publisher: release.yml on git-pull/gp-sphinx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_autodoc_typehints_gp-0.0.1a11-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_autodoc_typehints_gp-0.0.1a11-py3-none-any.whl
Algorithm Hash digest
SHA256 7657b0f14f07d1f2ea6140d4c65ab63578243184fbd60268e891bfa1ef0561f6
MD5 d63c9334a86684fb126919fc3a42fc45
BLAKE2b-256 4941c13b9ed7a5ea15dfb8af04271cf0594dced26a5b8519ba22ff208a2d7a81

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_autodoc_typehints_gp-0.0.1a11-py3-none-any.whl:

Publisher: release.yml on git-pull/gp-sphinx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page