Skip to content

Pin pygments<2.20 in docs extra to fix mkdocs build - #5

Merged
aronwalsh merged 1 commit into
mainfrom
fix/docs-pygments-pin
Aug 27, 2026
Merged

aronwalsh merged 1 commit into
mainfrom
fix/docs-pygments-pin

Conversation

@aronwalsh

Copy link
Copy Markdown
Member

Summary

mkdocs build failed with Error reading page 'api/analysis.md': 'NoneType' object has no attribute 'replace' — actually affecting every mkdocstrings page whose docstrings contain a numpy Examples doctest section (api/core.md, api/io.md, ...); analysis.md just failed first.

Root cause is a dependency incompatibility, not repo code: pymdown-extensions 10.20 passes filename=None to Pygments' BlockHtmlFormatter (pymdownx/highlight.py:410), and Pygments 2.20.0 no longer coerces None before html.escape(). Pin pygments<2.20 in the docs extra; the pin can be dropped once pymdown-extensions passes filename=title or "".

Test plan

  • With pygments 2.19.2: mkdocs build completes with zero errors and zero warnings.
  • pytest tests/: 138 passed, 31 skipped (unaffected, docs-only dep change).

🤖 Generated with Claude Code

mkdocs build failed with "Error reading page 'api/analysis.md':
'NoneType' object has no attribute 'replace'" on every mkdocstrings
page whose docstrings contain an Examples doctest section.

Root cause is a version incompatibility, not repo code:
pymdown-extensions 10.20 passes filename=None to Pygments'
BlockHtmlFormatter (pymdownx/highlight.py:410) and Pygments 2.20.0 no
longer coerces None before html.escape(). Pin pygments<2.20 in the
docs extra; drop the pin once pymdown-extensions passes
filename=title or "".
@aronwalsh
aronwalsh merged commit 8e8a11c into main Aug 27, 2026
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