[Python-modules-commits] [python-testfixtures] 03/07: Use local objects.inv where possible

Michael Fladischer fladi at moszumanska.debian.org
Sat Jan 28 15:40:03 UTC 2017


This is an automated email from the git hooks/post-receive script.

fladi pushed a commit to branch master
in repository python-testfixtures.

commit ef4865dec81eaa5dd24c6c07edbffc10db783e36
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date:   Fri Jan 27 09:50:38 2017 +0100

    Use local objects.inv where possible
    
    Upstream uses intersphinx mappings that fetch the objects.inv for python by
    HTTP from a remote host. Using the local objects.inv from python enables the
    package to build without network connection.
---
 docs/conf.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/docs/conf.py b/docs/conf.py
index 602454b..48b009b 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -12,7 +12,17 @@ extensions = [
     'sphinx.ext.intersphinx'
     ]
 
-intersphinx_mapping = {'http://docs.python.org': None}
+def check_object_path(key, url, path):
+    if os.path.isfile(path):
+        return {key: (url, path)}
+    return {}
+
+intersphinx_mapping = {}
+intersphinx_mapping.update(check_object_path('python',
+                                            'https://docs.python.org/',
+                                            '/usr/share/doc/python'
+                                              + '.'.join([str(x) for x in sys.version_info[0:2]])
+                                              + '/html/objects.inv'))
 
 # General
 source_suffix = '.txt'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-testfixtures.git



More information about the Python-modules-commits mailing list