Skip to content

Commit 046cdde

Browse files
authored
fix: pin Pygments <2.20 to fix docs build (#185)
## Summary - Pins Pygments to `>=2.19.2,<2.20` in the docs dependency group to avoid a breaking change in Pygments 2.20.0 - Pygments 2.20.0 (bumped in #182) introduced a regression in `HtmlFormatter.__init__` where `_decodeifneeded()` returns `None`, causing `pymdown-extensions` to crash with `AttributeError: 'NoneType' object has no attribute 'replace'` when rendering function signatures via `mkdocstrings` - This broke the "Build documentation" step in the Release workflow ([failed run](https://github.com/scaleapi/scale-agentex/actions/runs/23954964095/job/69871063041)) ## Test plan - [x] `mkdocs build` succeeds locally with Pygments 2.19.2 - [ ] CI Release workflow passes on merge <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR is a targeted dependency fix that pins `Pygments` to `>=2.19.2,<2.20` in the `docs` dependency 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. - Adds `Pygments>=2.19.2,<2.20` to the `docs` dependency group in `pyproject.toml` and updates `uv.lock` accordingly. - The upper-bound pin (`<2.20`) is conservative — using `!=2.20.0` would be less restrictive and would automatically pick up any 2.20.x patch that fixes the upstream regression. - `uv.lock` also contains unrelated additions for `claude_agent_sdk-0.1.49` (a new `sdist` entry and an `x86_64` wheel) that appear to have been swept in when `uv lock` was re-run; these are harmless but worth noting. - A pre-existing duplicate of `agentex-sdk` exists in the `docs` dependency group (lines 60 and 64) — this was not introduced by this PR. <details><summary><h3>Confidence Score: 5/5</h3></summary> 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 `docs` dependency group, has no impact on production or test code, and is well-explained. The only minor concerns are the choice of `<2.20` vs `!=2.20.0` and the unrelated lockfile entries, neither of which is a blocker. No files require special attention; both changed files are dependency-management artifacts. </details> <h3>Important Files Changed</h3> | Filename | Overview | |----------|----------| | agentex/pyproject.toml | Adds `Pygments>=2.19.2,<2.20` to the docs dependency group to work around the 2.20.0 regression; note that `agentex-sdk` is listed twice in this group (pre-existing duplicate). | | uv.lock | Lockfile updated to reflect the Pygments constraint; also includes unrelated sdist and x86_64 wheel additions for claude_agent_sdk-0.1.49 that were swept in by re-running uv lock. | </details> <details><summary><h3>Flowchart</h3></summary> ```mermaid %%{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 ✅] ``` </details> <details><summary>Prompt To Fix All With AI</summary> `````markdown This is a comment left during a code review. Path: agentex/pyproject.toml Line: 63 Comment: **Consider `!=2.20.0` instead of `<2.20`** The PR description says the regression is specifically in Pygments 2.20.0. Pinning `<2.20` will also block any future 2.20.x patch releases that might fix the issue (e.g. 2.20.1). Using `!=2.20.0` would be less restrictive and would allow a future patch fix to be picked up automatically. ```suggestion "Pygments>=2.19.2,!=2.20.0", ``` If the intent is to stay cautious until upstream confirms a fix, the current `<2.20` pin is acceptable — but worth revisiting once the Pygments team releases a patch. How can I resolve this? If you propose a fix, please make it concise. --- This is a comment left during a code review. Path: uv.lock Line: 521-527 Comment: **Unrelated `claude_agent_sdk` lockfile changes** The diff includes an added `sdist` entry and a new `x86_64` wheel for `claude_agent_sdk-0.1.49` that are unrelated to the Pygments pin. These appear to have been swept in when `uv lock` was re-run. While this is harmless, mixing unrelated lockfile changes makes the PR harder to audit. Consider either reverting those hunks or noting why they are included. How can I resolve this? If you propose a fix, please make it concise. ````` </details> <sub>Reviews (1): Last reviewed commit: ["fix: pin Pygments &lt;2.20 to fix docs buil..."](b9c20a2) | [Re-trigger Greptile](https://app.greptile.com/api/retrigger?id=27296664)</sub> <!-- /greptile_comment -->
1 parent 0aa5c2c commit 046cdde

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

agentex/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ docs = [
6060
"agentex-sdk",
6161
"griffe-pydantic>=1.1.4",
6262
"pymdown-extensions>=10.0,<11",
63+
"Pygments>=2.19.2,<2.20",
6364
"agentex-sdk",
6465
]
6566

uv.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)