Skip to content

Commit

Permalink
docs: Use intersphinx_registry to keep intersphinx urls up to date (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
Carreau authored Dec 3, 2024
1 parent 373bcdb commit 001d477
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
21 changes: 12 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from pathlib import Path

import jupytext
from intersphinx_registry import get_intersphinx_mapping

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

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

intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'numpy': ('https://numpy.org/doc/stable/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/', None),
'matplotlib': ('https://matplotlib.org/stable/', None),
'iminuit': ('https://iminuit.readthedocs.io/en/stable/', None),
'uproot': ('https://uproot.readthedocs.io/en/latest/', None),
'jsonpatch': ('https://python-json-patch.readthedocs.io/en/latest/', None),
}
intersphinx_mapping = get_intersphinx_mapping(
packages={
'python',
'numpy',
'scipy',
'matplotlib',
'iminuit',
'uproot',
'jsonpatch',
}
)

# GitHub repo
issues_github_path = 'scikit-hep/pyhf'
Expand Down
1 change: 1 addition & 0 deletions docs/contributors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ Contributors include:
- Jonas Rembser
- Lorenz Gaertner
- Melissa Weber Mendonça
- Matthias Bussonnier
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ docs = [
"pydata-sphinx-theme>=0.15.3",
"nbsphinx!=0.8.8", # c.f. https://github.com/spatialaudio/nbsphinx/issues/620
"ipywidgets",
"intersphinx_registry>=0.2411.17",
"sphinx-issues",
"sphinx-copybutton>=0.3.2,!=0.5.1",
"jupyterlite-sphinx>=0.13.1", # c.f. https://github.com/scikit-hep/pyhf/pull/2458
Expand Down

0 comments on commit 001d477

Please sign in to comment.