Skip to content

Commit 001d477

Browse files
authored
docs: Use intersphinx_registry to keep intersphinx urls up to date (#2559)
* Add intersphinx_registry to 'docs' extra. * Use intersphinx_registry to provide automated inter Sphinx mapping. - c.f. https://github.com/Quansight-labs/intersphinx_registry * Add Matthias Bussonnier to contributors list.
1 parent 373bcdb commit 001d477

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

docs/conf.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from pathlib import Path
2121

2222
import jupytext
23+
from intersphinx_registry import get_intersphinx_mapping
2324

2425
sys.path.insert(0, str(Path('./exts').resolve()))
2526

@@ -80,15 +81,17 @@ def setup(app):
8081
# external links
8182
xref_links = {"arXiv:1007.1727": ("[1007.1727]", "https://arxiv.org/abs/1007.1727")}
8283

83-
intersphinx_mapping = {
84-
'python': ('https://docs.python.org/3', None),
85-
'numpy': ('https://numpy.org/doc/stable/', None),
86-
'scipy': ('https://docs.scipy.org/doc/scipy/', None),
87-
'matplotlib': ('https://matplotlib.org/stable/', None),
88-
'iminuit': ('https://iminuit.readthedocs.io/en/stable/', None),
89-
'uproot': ('https://uproot.readthedocs.io/en/latest/', None),
90-
'jsonpatch': ('https://python-json-patch.readthedocs.io/en/latest/', None),
91-
}
84+
intersphinx_mapping = get_intersphinx_mapping(
85+
packages={
86+
'python',
87+
'numpy',
88+
'scipy',
89+
'matplotlib',
90+
'iminuit',
91+
'uproot',
92+
'jsonpatch',
93+
}
94+
)
9295

9396
# GitHub repo
9497
issues_github_path = 'scikit-hep/pyhf'

docs/contributors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ Contributors include:
3535
- Jonas Rembser
3636
- Lorenz Gaertner
3737
- Melissa Weber Mendonça
38+
- Matthias Bussonnier

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ docs = [
121121
"pydata-sphinx-theme>=0.15.3",
122122
"nbsphinx!=0.8.8", # c.f. https://github.com/spatialaudio/nbsphinx/issues/620
123123
"ipywidgets",
124+
"intersphinx_registry>=0.2411.17",
124125
"sphinx-issues",
125126
"sphinx-copybutton>=0.3.2,!=0.5.1",
126127
"jupyterlite-sphinx>=0.13.1", # c.f. https://github.com/scikit-hep/pyhf/pull/2458

0 commit comments

Comments
 (0)