From 5a8a32a74202a9a4d2728dc6f3d4fa7632d37a89 Mon Sep 17 00:00:00 2001 From: M Bussonnier Date: Mon, 3 Jun 2024 11:00:10 -0700 Subject: [PATCH 1/4] Use intersphinx registry to avoid out of date links. --- doc/conf.py | 9 ++++----- pyproject.toml | 1 + requirements/doc.txt | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 9bffda88..397033e0 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -14,6 +14,8 @@ import numpydoc +from intersphinx_registry import get_intersphinx_mapping + # for example.py sys.path.insert(0, os.path.abspath(".")) # project root @@ -137,8 +139,5 @@ # -- 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/devdocs/", None), - "sklearn": ("https://scikit-learn.org/stable/", None), -} + +intersphinx_mapping = get_intersphinx_mapping(["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 From d8eb6039bd1bb94bb58b600e52bc40eac18aa867 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 3 Jun 2024 14:40:55 -0400 Subject: [PATCH 2/4] Update doc/conf.py --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 397033e0..39ea8c04 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -140,4 +140,4 @@ # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = get_intersphinx_mapping(["python", "numpy", "sklearn"]) +intersphinx_mapping = get_intersphinx_mapping(packages=["python", "numpy", "sklearn"]) From eab17042ac63b706b80a4079ed88d3a0d270434b Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 3 Jun 2024 14:45:11 -0400 Subject: [PATCH 3/4] Update conf.py --- doc/conf.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 893e69a8..d69682f4 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -138,14 +138,6 @@ # -- Intersphinx setup ---------------------------------------------------- -# Example configuration for intersphinx: refer to the Python standard library. -<<<<<<< intersphinx_registry +# Example configuration for intersphinx: refer to several Python libraries. intersphinx_mapping = get_intersphinx_mapping(packages=["python", "numpy", "sklearn"]) -======= -intersphinx_mapping = { - "python": ("https://docs.python.org/3/", None), - "numpy": ("https://numpy.org/doc/stable/", None), - "sklearn": ("https://scikit-learn.org/stable/", None), -} ->>>>>>> main From 07868e137c6773c70fa94eb37a10f02b82541aec Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 3 Jun 2024 11:48:08 -0700 Subject: [PATCH 4/4] FIX: Order --- doc/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index d69682f4..519fb795 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -12,10 +12,10 @@ import sys from datetime import date -import numpydoc - from intersphinx_registry import get_intersphinx_mapping +import numpydoc + # for example.py sys.path.insert(0, os.path.abspath(".")) # project root