Skip to content

Commit 5a8a32a

Browse files
committed
Use intersphinx registry to avoid out of date links.
1 parent acad4ec commit 5a8a32a

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

doc/conf.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
import numpydoc
1616

17+
from intersphinx_registry import get_intersphinx_mapping
18+
1719
# for example.py
1820
sys.path.insert(0, os.path.abspath("."))
1921
# project root
@@ -137,8 +139,5 @@
137139
# -- Intersphinx setup ----------------------------------------------------
138140

139141
# Example configuration for intersphinx: refer to the Python standard library.
140-
intersphinx_mapping = {
141-
"python": ("https://docs.python.org/3/", None),
142-
"numpy": ("https://numpy.org/devdocs/", None),
143-
"sklearn": ("https://scikit-learn.org/stable/", None),
144-
}
142+
143+
intersphinx_mapping = get_intersphinx_mapping(["python", "numpy", "sklearn"])

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ doc = [
5353
'matplotlib>=3.5',
5454
'pydata-sphinx-theme>=0.13.3',
5555
'sphinx>=7',
56+
'intersphinx_registry',
5657
]
5758
test = [
5859
'pytest',

requirements/doc.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ numpy>=1.22
44
matplotlib>=3.5
55
pydata-sphinx-theme>=0.13.3
66
sphinx>=7
7+
intersphinx_registry

0 commit comments

Comments
 (0)