Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
29231: fallback for scipy inventory file when not connected to internet
Browse files Browse the repository at this point in the history
  • Loading branch information
mwageringel committed Feb 21, 2020
1 parent 3bd5293 commit 2bd8a8a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/sage/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,20 @@ def sphinx_plot(graphics, **kwds):

# Cross-links to other project's online documentation.
python_version = sys.version_info.major
python_inventory_file = os.path.join(SAGE_DOC_SRC, "common",
"python{}.inv".format(python_version))
# If connected to the internet, the inventory file will be downloaded for
# projects that have `None` as first argument to the second inventory tuple
# item. To avoid docbuild failures when building Sage without internet
# connection, we use the local python inventory file as a fallback for other
# projects. Cross-references will not be resolved in that case, but the
# docbuild will still succeed.
dummy_inventory_file = python_inventory_file
intersphinx_mapping = {
'python': ('https://docs.python.org/',
os.path.join(SAGE_DOC_SRC, "common",
"python{}.inv".format(python_version))),
'python': ('https://docs.python.org/', python_inventory_file),
'pplpy': (PPLPY_DOCS, None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None)}
'scipy': ('https://docs.scipy.org/doc/scipy/reference/',
(None, dummy_inventory_file))}

def set_intersphinx_mappings(app):
"""
Expand Down

0 comments on commit 2bd8a8a

Please sign in to comment.