Debian Codegraph @

debian/patches/0003-Use-local-intersphinx-files.patch

raw
1 From: Andrey Rakhmatullin <[email protected]>
2 Date: Sat, 9 Aug 2025 15:35:40 +0500
3 Subject: Use local intersphinx files.
4
5 ---
6 doc/conf.py | 26 ++++++++++++++++++++++----
7 1 file changed, 22 insertions(+), 4 deletions(-)
8
9 diff --git a/doc/conf.py b/doc/conf.py
10 index aa83ac8..edd41c9 100644
11 --- a/doc/conf.py
12 +++ b/doc/conf.py
13 @@ -249,7 +249,25 @@ latex_documents = [
14 # (source start file, name, description, authors, manual section).
15 man_pages = [("index", "pyopenssl", "pyOpenSSL Documentation", [authors], 1)]
16
17 -intersphinx_mapping = {
18 - "python": ("https://docs.python.org/3", None),
19 - "cryptography": ("https://cryptography.io/en/latest/", None),
20 -}
21 +
22 +def check_object_path(key, url, path):
23 + if os.path.isfile(path):
24 + return {key: (url, path)}
25 + return {}
26 +
27 +
28 +intersphinx_mapping = {}
29 +intersphinx_mapping.update(
30 + check_object_path(
31 + "cryptography",
32 + "https://cryptography.io/en/latest/",
33 + "/usr/share/doc/python-cryptography-doc/html/objects.inv",
34 + )
35 +)
36 +intersphinx_mapping.update(
37 + check_object_path(
38 + "python",
39 + "https://docs.python.org/3",
40 + "/usr/share/doc/python%d.%d/html/objects.inv" % sys.version_info[:2],
41 + )
42 +)