From 06236d04c082d011871920ace6494cb0b03a420a Mon Sep 17 00:00:00 2001 From: faresrafat3 Date: Thu, 1 Oct 2026 15:37:59 +0300 Subject: [PATCH] Enable intersphinx so stdlib references resolve Building the docs with `sphinx-build -n` reports many "py:class reference target not found" warnings for annotations such as collections.abc.Mapping, datetime.datetime and collections.abc.Sequence, because no intersphinx mapping is configured (see #192). Add the sphinx.ext.intersphinx extension with the Python inventory. Warnings under -n drop from 55 to 31. The remainder are project-internal references (tomlkit.items.ItemT, tomlkit.container.Container, E, Encoder) that are not part of this change. Fixes #192 (partially). --- docs/conf.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index cbb9ee44..cf4e8159 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -36,8 +36,17 @@ # ones. extensions = [ "sphinx.ext.autodoc", + "sphinx.ext.intersphinx", ] +# Resolve references to the standard library and other projects, so that +# annotations such as collections.abc.Mapping or datetime.datetime link to +# their documentation instead of producing "reference target not found" +# warnings under `sphinx-build -n`. +intersphinx_mapping = { + "python": ("https://docs.python.org/3", None), +} + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"]