Skip to content

docs: fall back to vendored intersphinx inventories - #376

Merged
thomaspinder merged 1 commit into
mainfrom
docs/vendor-intersphinx-inventories
Oct 1, 2026
Merged

thomaspinder merged 1 commit into
mainfrom
docs/vendor-intersphinx-inventories

Conversation

@thomaspinder

Copy link
Copy Markdown
Collaborator

Motivation

build-docs fails on every PR while docs.python.org is down. The site returns 503 Service Unavailable on every URL, including https://docs.python.org/3/objects.inv. Intersphinx downloads that inventory, together with five others, on every build. The PR build runs sphinx-build -W (make docs-ci), and an unreachable inventory is a warning, so the build fails. That warning has no type, so suppress_warnings cannot target it. Any of the six sites having a bad hour blocks every PR (it is blocking #375 now).

Solution

Use the fallback that GPJax already uses. Each intersphinx_mapping entry lists the upstream inventory first and then a vendored copy in docs/_inventories/. If the upstream fetch fails and the vendored copy loads, intersphinx logs only info, so the build stays green under -W and the links still resolve.

The vendored inventories:

Inventory Version Source
numpy.inv NumPy 2.5 downloaded today
pandas.inv pandas 3.0.6 downloaded today
arviz.inv ArviZ 1.3.0 downloaded today
pymc.inv PyMC 6.3.2 downloaded today
matplotlib.inv Matplotlib 3.11.2 downloaded today
python.inv Python 3.14 copied from GPJax's vendored copy (2026-08-01), because docs.python.org is down

The cost is that the vendored copies go stale. This only affects builds where the upstream fetch failed. The docs/conf.py comment says how to refresh them.

Verification

I ran two throwaway Sphinx 9.0.4 builds with -W --keep-going while docs.python.org was returning 503:

  • With the old mapping, the build fails: failed to reach any of the inventories ... 503 Server Error, "1 warning (with warnings treated as errors)". This is the failure CI hits.
  • With the new mapping, the build succeeds. str, datetime.datetime, numpy.ndarray, pandas.DataFrame, matplotlib.pyplot.plot and pymc.sample all resolve to their upstream pages.

All six inventories decode, with between 309 and 19,317 entries each. ruff check, ruff format --check and the repo's prek hooks pass on the changed files, and identify tags the .inv files as binary, so the text hooks skip them.

🤖 Generated with Claude Code

https://claude.ai/code/session_015fagcMeo1LmLG2Dg3NybmQ

The strict PR docs build (-W) fails whenever one of the six upstream
inventories is unreachable; a docs.python.org outage (503 on every URL)
is failing build-docs on every open PR. List a vendored copy under
docs/_inventories/ after each upstream location, as GPJax does:
intersphinx uses the first that loads and logs only info when the
upstream one fails, so the build stays green and links still resolve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015fagcMeo1LmLG2Dg3NybmQ
@thomaspinder
thomaspinder enabled auto-merge October 1, 2026 09:11
@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@thomaspinder
thomaspinder merged commit 0031f5f into main Oct 1, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant