Skip to content

Fix Read the Docs build (pin sphinx <9) and close the remaining mistune advisory - #467

Merged
aaronspring merged 5 commits into
mainfrom
claude/package-necessity-review-aefqff
Sep 21, 2026
Merged

aaronspring merged 5 commits into
mainfrom
claude/package-necessity-review-aefqff

Conversation

@aaronspring

@aaronspring aaronspring commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

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.yml asks for sphinx >=6.0.0 and leaves Python open (python >=3.10,<3.14), so mamba resolves Python 3.13 + Sphinx 9. Importing sphinx_autosummary_accessors in docs/source/conf.py then aborts the build before any page is read:

AttributeError: type object 'Autosummary' has no attribute 'create_documenter'

Autosummary.create_documenter was removed in Sphinx 9 (released 2025-11-30); sphinx-autosummary-accessors 2025.3.1 — still the latest release — patches it at import time.

Why CI stayed green: the docs_notebooks job 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,<9 in ci/doc.yml, ci/dev.yml, ci/docs_notebooks.yml and the complete extra, with a comment pointing at the reason, until the extension supports Sphinx 9. uv.lock is 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 in uv.lock against 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

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Reproduced and verified locally, outside conda, in an environment resolved from .[complete]:

  • Python 3.13 + Sphinx 9.0.4 (pre-fix resolution): build aborts at conf.py with the create_documenter AttributeError above.
  • Python 3.13 + Sphinx 8.2.3 (post-fix resolution): python -m sphinx -T -b html …build succeeded, 12 warnings, including the sphinx-llm pass (llms.txt, llms-full.txt, 58 context files). The warnings are pre-existing nbsphinx node-type warnings, and RTD runs with fail_on_warning: false.

Notebook execution was disabled for the local run only (-D nbsphinx_execute=never), because tabular-data.ipynb downloads the California-housing dataset and this sandbox has no egress for it; notebook execution is already covered by the docs_notebooks CI job.

The RTD check on this PR is the real verification.

Pre-Merge Checklist (final steps)

  • Branched off current main; no conflicts.
  • Commits are squashed on merge (the branch carries a pre-commit.ci autofix commit that reverts stray autosummary churn from a local docs build).

References

  • Sphinx 9 removed Autosummary.create_documenter
  • sphinx-autosummary-accessors latest release 2025.3.1 declares sphinx>=5.3 with no upper bound
  • GHSA-6m44-fpc8-c3rq (mistune, fixed in 3.3.3)

🤖 Generated with Claude Code

https://claude.ai/code/session_01LxD6E7Wj42YJXQ9GxyAJLV

aaronspring and others added 4 commits September 21, 2026 17:04
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
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
@aaronspring aaronspring changed the title Fix Read the Docs build by pinning sphinx &lt;9 Fix Read the Docs build (pin sphinx &lt;9) and close the remaining mistune advisory Sep 21, 2026
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.52%. Comparing base (e457985) to head (5daf506).
⚠️ Report is 8 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aaronspring
aaronspring merged commit 9d730e5 into main Sep 21, 2026
17 checks passed
@aaronspring
aaronspring deleted the claude/package-necessity-review-aefqff branch September 21, 2026 17:13
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