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.1a34.tar.gz (36.9 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.1a34-py3-none-any.whl (39.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for sphinx_autodoc_typehints_gp-0.0.1a34.tar.gz
Algorithm Hash digest
SHA256 97b9f197e6d3205745db3cad7ba6eb1668ce57680c2cae7c8550e0ce01f6098a
MD5 5fe4078a7cad08bde88f875863970048
BLAKE2b-256 dd4acedc7da36921ba7fdb98d6b9f4b7a9f0d1546be3c84dae6e1667a185d77e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_autodoc_typehints_gp-0.0.1a34.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.1a34-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_autodoc_typehints_gp-0.0.1a34-py3-none-any.whl
Algorithm Hash digest
SHA256 dd5575e4d904940eba0a59e1510666de512006a8df7893448bef9143aaabf64d
MD5 aa2a552f5900a3b2c8654fbba068cfce
BLAKE2b-256 5105f49438bedcf8613666d3019b1d2d5816a58711fd944b5a6c64de2980f62d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_autodoc_typehints_gp-0.0.1a34-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