fix: pin Pygments <2.20 to fix docs build#185
Merged
Conversation
Pygments 2.20.0 introduced a breaking change in HtmlFormatter where _decodeifneeded() can return None, causing pymdown-extensions to crash with 'NoneType' object has no attribute 'replace' when rendering function signatures via mkdocstrings.
smoreinis
added a commit
that referenced
this pull request
Apr 3, 2026
The previous fix (#185) added a Pygments<2.20 constraint to pyproject.toml but the lockfile was never re-resolved, so CI continued installing Pygments 2.20.0 which breaks the mkdocs build.
1 task
smoreinis
added a commit
that referenced
this pull request
Apr 3, 2026
## Summary - Re-resolves `uv.lock` to actually downgrade Pygments from 2.20.0 to 2.19.2 - The previous fix (#185) added `Pygments<2.20` to `pyproject.toml` but never re-resolved the lockfile (`uv lock` used a cached resolution), so CI continued installing 2.20.0 - This is why the docs build is still failing on main — `uv sync --group docs` installs from the lockfile, which still had 2.20.0 ## Test plan - [ ] CI docs build passes (the `Build Documentation` job that's been failing)
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.
Summary
>=2.19.2,<2.20in the docs dependency group to avoid a breaking change in Pygments 2.20.0HtmlFormatter.__init__where_decodeifneeded()returnsNone, causingpymdown-extensionsto crash withAttributeError: 'NoneType' object has no attribute 'replace'when rendering function signatures viamkdocstringsTest plan
mkdocs buildsucceeds locally with Pygments 2.19.2Greptile Summary
This PR is a targeted dependency fix that pins
Pygmentsto>=2.19.2,<2.20in thedocsdependency group to unblock the docs build broken by a regression introduced in Pygments 2.20.0. The fix is straightforward and correct for its stated purpose.Pygments>=2.19.2,<2.20to thedocsdependency group inpyproject.tomland updatesuv.lockaccordingly.<2.20) is conservative — using!=2.20.0would be less restrictive and would automatically pick up any 2.20.x patch that fixes the upstream regression.uv.lockalso contains unrelated additions forclaude_agent_sdk-0.1.49(a newsdistentry and anx86_64wheel) that appear to have been swept in whenuv lockwas re-run; these are harmless but worth noting.agentex-sdkexists in thedocsdependency group (lines 60 and 64) — this was not introduced by this PR.Confidence Score: 5/5
Safe to merge — the change is a minimal, targeted dependency pin that unblocks the docs build with no impact on runtime code.
The change only affects the
docsdependency group, has no impact on production or test code, and is well-explained. The only minor concerns are the choice of<2.20vs!=2.20.0and the unrelated lockfile entries, neither of which is a blocker.No files require special attention; both changed files are dependency-management artifacts.
Important Files Changed
Pygments>=2.19.2,<2.20to the docs dependency group to work around the 2.20.0 regression; note thatagentex-sdkis listed twice in this group (pre-existing duplicate).Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[mkdocs build] --> B{Pygments version} B -- "2.20.0 (broken)" --> C["HtmlFormatter.__init__\n_decodeifneeded() → None"] C --> D["AttributeError: 'NoneType'\n.replace() in pymdown-extensions"] D --> E[Build fails ❌] B -- ">=2.19.2,<2.20 (pinned)" --> F[HtmlFormatter works correctly] F --> G[mkdocstrings renders function signatures] G --> H[Build succeeds ✅]Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix: pin Pygments <2.20 to fix docs buil..." | Re-trigger Greptile