From 58530b92ba8d5a7528b9f3b8b7535d86ecd2b227 Mon Sep 17 00:00:00 2001 From: M Bussonnier Date: Mon, 3 Jun 2024 11:50:44 -0700 Subject: [PATCH] Use intersphinx registry to avoid out of date links. (#563) * Use intersphinx registry to avoid out of date links. * Update doc/conf.py --------- Co-authored-by: Eric Larson --- doc/conf.py | 11 +++++------ pyproject.toml | 1 + requirements/doc.txt | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index b1b2e63d..519fb795 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -12,6 +12,8 @@ import sys from datetime import date +from intersphinx_registry import get_intersphinx_mapping + import numpydoc # for example.py @@ -136,9 +138,6 @@ # -- Intersphinx setup ---------------------------------------------------- -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("https://docs.python.org/3/", None), - "numpy": ("https://numpy.org/doc/stable/", None), - "sklearn": ("https://scikit-learn.org/stable/", None), -} +# Example configuration for intersphinx: refer to several Python libraries. + +intersphinx_mapping = get_intersphinx_mapping(packages=["python", "numpy", "sklearn"]) diff --git a/pyproject.toml b/pyproject.toml index e882da19..5ee947a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,6 +53,7 @@ doc = [ 'matplotlib>=3.5', 'pydata-sphinx-theme>=0.13.3', 'sphinx>=7', + 'intersphinx_registry', ] test = [ 'pytest', diff --git a/requirements/doc.txt b/requirements/doc.txt index f3d9b058..950966b6 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -4,3 +4,4 @@ numpy>=1.22 matplotlib>=3.5 pydata-sphinx-theme>=0.13.3 sphinx>=7 +intersphinx_registry