File: 0006-Use-local-Sphinx-inventories-where-available.patch

package info (click to toggle)
python-aiohttp 3.12.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 16,900 kB
  • sloc: python: 61,659; ansic: 20,773; makefile: 396; sh: 3
file content (59 lines) | stat: -rw-r--r-- 2,994 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From: Colin Watson <cjwatson@debian.org>
Date: Sun, 18 Aug 2024 12:01:35 +0100
Subject: Use local Sphinx inventories where available

---
 docs/conf.py | 40 +++++++++++++++++++++++-----------------
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index b2faaf5..00a900e 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -71,23 +71,29 @@ try:
 except ImportError:
     pass
 
-
-intersphinx_mapping = {
-    "pytest": ("http://docs.pytest.org/en/latest/", None),
-    "python": ("http://docs.python.org/3", None),
-    "multidict": ("https://multidict.readthedocs.io/en/stable/", None),
-    "propcache": ("https://propcache.aio-libs.org/en/stable", None),
-    "yarl": ("https://yarl.readthedocs.io/en/stable/", None),
-    "aiosignal": ("https://aiosignal.readthedocs.io/en/stable/", None),
-    "aiohttpjinja2": ("https://aiohttp-jinja2.readthedocs.io/en/stable/", None),
-    "aiohttpremotes": ("https://aiohttp-remotes.readthedocs.io/en/stable/", None),
-    "aiohttpsession": ("https://aiohttp-session.readthedocs.io/en/stable/", None),
-    "aiohttpdemos": ("https://aiohttp-demos.readthedocs.io/en/latest/", None),
-    "aiojobs": ("https://aiojobs.readthedocs.io/en/stable/", None),
-    "aiohappyeyeballs": ("https://aiohappyeyeballs.readthedocs.io/en/latest/", None),
-    "isal": ("https://python-isal.readthedocs.io/en/stable/", None),
-    "zlib_ng": ("https://python-zlib-ng.readthedocs.io/en/stable/", None),
-}
+def check_object_path(key, url, path):
+    if path is not None and os.path.isfile(path):
+        return {key: (url, path)}
+    return {}
+
+intersphinx_mapping = {}
+for key, url, path in (
+    ("pytest", "http://docs.pytest.org/en/latest/", "/usr/share/doc/python-pytest-doc/html/objects.inv"),
+    ("python", "http://docs.python.org/3", "/usr/share/doc/python3/html/objects.inv"),
+    ("multidict", "https://multidict.readthedocs.io/en/stable/", None),
+    ("propcache", "https://propcache.aio-libs.org/en/stable", None),
+    ("yarl", "https://yarl.readthedocs.io/en/stable/", "/usr/share/doc/python-yarl-doc/html/objects.inv"),
+    ("aiosignal", "https://aiosignal.readthedocs.io/en/stable/", None),
+    ("aiohttpjinja2", "https://aiohttp-jinja2.readthedocs.io/en/stable/", None),
+    ("aiohttpremotes", "https://aiohttp-remotes.readthedocs.io/en/stable/", None),
+    ("aiohttpsession", "https://aiohttp-session.readthedocs.io/en/stable/", None),
+    ("aiohttpdemos", "https://aiohttp-demos.readthedocs.io/en/latest/", None),
+    ("aiojobs", "https://aiojobs.readthedocs.io/en/stable/", None),
+    ("aiohappyeyeballs", "https://aiohappyeyeballs.readthedocs.io/en/latest/", None),
+    ("isal", "https://python-isal.readthedocs.io/en/stable/", None),
+    ("zlib_ng", "https://python-zlib-ng.readthedocs.io/en/stable/", None),
+):
+    intersphinx_mapping.update(check_object_path(key, url, path))
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ["_templates"]