| 1 |
From: Sebastian Ramacher <[email protected]> |
| 2 |
Date: Thu, 14 Jul 2016 23:01:01 +0200 |
| 3 |
Subject: Use local intersphinx mappings |
| 4 |
|
| 5 |
Forwarded: not-needed |
| 6 |
--- |
| 7 |
doc/en/conf.py | 11 +++++++---- |
| 8 |
1 file changed, 7 insertions(+), 4 deletions(-) |
| 9 |
|
| 10 |
diff --git a/doc/en/conf.py b/doc/en/conf.py |
| 11 |
index 04ba1cf..359d856 100644 |
| 12 |
--- a/doc/en/conf.py |
| 13 |
+++ b/doc/en/conf.py |
| 14 |
@@ -133,14 +133,17 @@ autodoc_typehints_description_target = "documented" |
| 15 |
# -- Options for intersphinx ---------------------------------------------------------- |
| 16 |
# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#configuration |
| 17 |
|
| 18 |
+def use_if_available(path): |
| 19 |
+ return path if os.path.isfile(path) else None |
| 20 |
+ |
| 21 |
intersphinx_mapping = { |
| 22 |
- "pluggy": ("https://pluggy.readthedocs.io/en/stable", None), |
| 23 |
- "python": ("https://docs.python.org/3", None), |
| 24 |
- "numpy": ("https://numpy.org/doc/stable", None), |
| 25 |
+ "pluggy": ("https://pluggy.readthedocs.io/en/stable", use_if_available("/usr/share/doc/python-pluggy/html/objects.inv")), |
| 26 |
+ "python": ("https://docs.python.org/3", use_if_available("/usr/share/doc/python3/html/objects.inv")), |
| 27 |
+ "numpy": ("https://numpy.org/doc/stable", use_if_available("/usr/share/doc/python-numpy/html/objects.inv")), |
| 28 |
"pip": ("https://pip.pypa.io/en/stable", None), |
| 29 |
"tox": ("https://tox.wiki/en/stable", None), |
| 30 |
"virtualenv": ("https://virtualenv.pypa.io/en/stable", None), |
| 31 |
- "setuptools": ("https://setuptools.pypa.io/en/stable", None), |
| 32 |
+ "setuptools": ("https://setuptools.pypa.io/en/stable", use_if_available("/usr/share/doc/python-setuptools-doc/html/objects.inv")), |
| 33 |
"packaging": ("https://packaging.python.org/en/latest", None), |
| 34 |
} |
| 35 |
|