Fix Read the Docs build (pin sphinx <9) and close the remaining mistune advisory - #467
Merged
Merged
Conversation
The Read the Docs build has been failing since Sphinx 9 was released.
ci/doc.yml asks for `sphinx >=6.0.0` and leaves the Python version open
(`python >=3.10,<3.14`), so mamba resolves Python 3.13 plus Sphinx 9,
and importing sphinx_autosummary_accessors in docs/source/conf.py then
aborts the build:
AttributeError: type object 'Autosummary' has no attribute
'create_documenter'
`Autosummary.create_documenter` was removed in Sphinx 9;
sphinx-autosummary-accessors 2025.3.1 (the latest release) still calls
it at import time. The docs_notebooks CI job stayed green only because
it pins Python 3.10, where the solver cannot pick Sphinx 8 or 9 at all
(both require Python >=3.11).
Pin `sphinx >=6.0.0,<9` in ci/doc.yml, ci/dev.yml, ci/docs_notebooks.yml
and the `complete` extra until the extension supports Sphinx 9, and
refresh uv.lock (it carried sphinx 9.0.4/9.1.0 for Python >=3.11).
Verified by building the docs in a Python 3.13 environment resolved from
`.[complete]`: Sphinx 8.2.3, build succeeded with 12 pre-existing
warnings (Read the Docs runs with fail_on_warning: false). The same
build on Sphinx 9.0.4 fails at conf.py import.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LxD6E7Wj42YJXQ9GxyAJLV
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LxD6E7Wj42YJXQ9GxyAJLV
for more information, see https://pre-commit.ci
Dependabot's #455 only went as far as mistune 3.3.0, which is itself affected by GHSA-6m44-fpc8-c3rq (fixed in 3.3.3) and left one open high-severity alert on main. Re-locking mistune picks 3.3.4; a scan of every registry-sourced package in uv.lock against the PyPI advisory data now reports no known vulnerabilities. mistune is a docs-only transitive dependency (nbsphinx -> nbconvert -> mistune), not a runtime dependency. Also restores docs/source/api/xskillscore.Contingency.rst to its state on main: running the docs build locally to reproduce the Read the Docs failure regenerated the autosummary stubs, and two trailing blank lines slipped into the first commit of this branch. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LxD6E7Wj42YJXQ9GxyAJLV
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #467 +/- ##
==========================================
- Coverage 94.57% 94.52% -0.06%
==========================================
Files 27 27
Lines 2841 2847 +6
==========================================
+ Hits 2687 2691 +4
- Misses 154 156 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two related fixes to the docs toolchain.
1. Read the Docs has been failing since Sphinx 9
RTD has failed on every PR for months (e.g. #455 in July, #465 last week), and it is the only job that builds the full docs, so nothing else caught it.
Root cause:
ci/doc.ymlasks forsphinx >=6.0.0and leaves Python open (python >=3.10,<3.14), so mamba resolves Python 3.13 + Sphinx 9. Importingsphinx_autosummary_accessorsindocs/source/conf.pythen aborts the build before any page is read:Autosummary.create_documenterwas removed in Sphinx 9 (released 2025-11-30);sphinx-autosummary-accessors2025.3.1 — still the latest release — patches it at import time.Why CI stayed green: the
docs_notebooksjob pins Python 3.10, and both Sphinx 8 and 9 require Python >= 3.11, so that env resolves Sphinx 7 and never sees the incompatibility.Fix: pin
sphinx >=6.0.0,<9inci/doc.yml,ci/dev.yml,ci/docs_notebooks.ymland thecompleteextra, with a comment pointing at the reason, until the extension supports Sphinx 9.uv.lockis refreshed accordingly (it carried sphinx 9.0.4/9.1.0 for Python >= 3.11).2. mistune 3.3.0 is itself vulnerable
Dependabot's #455 only went as far as mistune 3.3.0, which is affected by GHSA-6m44-fpc8-c3rq (fixed in 3.3.3), leaving one open high-severity alert on
main. Re-locking picks 3.3.4. Checking every registry-sourced package inuv.lockagainst the PyPI advisory data now reports no known vulnerabilities (147 packages scanned, 0 affected).mistune is a docs-only transitive dependency (
nbsphinx → nbconvert → mistune), not a runtime dependency of xskillscore.Type of change
How Has This Been Tested?
Reproduced and verified locally, outside conda, in an environment resolved from
.[complete]:conf.pywith thecreate_documenterAttributeError above.python -m sphinx -T -b html …→build succeeded, 12 warnings, including thesphinx-llmpass (llms.txt,llms-full.txt, 58 context files). The warnings are pre-existing nbsphinx node-type warnings, and RTD runs withfail_on_warning: false.Notebook execution was disabled for the local run only (
-D nbsphinx_execute=never), becausetabular-data.ipynbdownloads the California-housing dataset and this sandbox has no egress for it; notebook execution is already covered by thedocs_notebooksCI job.The RTD check on this PR is the real verification.
Pre-Merge Checklist (final steps)
main; no conflicts.References
Autosummary.create_documentersphinx-autosummary-accessorslatest release 2025.3.1 declaressphinx>=5.3with no upper bound🤖 Generated with Claude Code
https://claude.ai/code/session_01LxD6E7Wj42YJXQ9GxyAJLV