Skip to content

Use uv and pin pygments in readthedocs - #14550

Merged
reteps merged 3 commits into
masterfrom
reteps/pin-pygments
Mar 30, 2026
Merged

reteps merged 3 commits into
masterfrom
reteps/pin-pygments

Conversation

@reteps

@reteps reteps commented Mar 30, 2026 •

Copy link
Copy Markdown
Contributor

Description

Pin pygments==2.19.2 in the docs dependency group to work around a bug in Pygments 2.20.0 (pygments/pygments#3076) that breaks our docs build.

The main project dependencies already pin pygments==2.19.2, but the docs dependency group was unpinned and could pull in the broken version.

Testing

  • readthedocs build succeeds

🤖 Generated with Claude Code

Pygments 2.20.0 has a bug (pygments/pygments#3076) that breaks our
docs build. Pin to 2.19.2 until the issue is resolved.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@github-actions github-actions Bot added the python Requires Python code changes label Mar 30, 2026
@reteps
reteps marked this pull request as ready for review March 30, 2026 14:51
@reteps
reteps requested a review from a team as a code owner March 30, 2026 14:51
@reteps
reteps requested review from EduardoMVAz and nwalters512 and removed request for a team and nwalters512 March 30, 2026 14:51
@reteps reteps changed the title Pin pygments==2.19.2 in docs dependency group Pin pygments in docs dependency group Mar 30, 2026
@coderabbitai

coderabbitai Bot commented Mar 30, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Added a pinned pygments==2.19.2 entry to the docs dependency group in pyproject.toml. Updated Read the Docs build config .readthedocs.yml to use uv (installed via asdf) for environment creation and to run uv sync --frozen --group docs during install.

Changes

Cohort / File(s) Summary
Documentation dependencies
pyproject.toml
Added explicit pygments==2.19.2 pin in the docs dependency-group with a comment referencing Pygments issue #3076.
Read the Docs CI config
.readthedocs.yml
Switched environment creation/install flow to use uv installed via asdf; added pre_create_environment steps to install/activate uv, replaced pip-based setup with uv venv and uv sync --frozen --group docs; preserved pre_build d2 install/copy steps.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title mentions two distinct changes (uv and pygments pinning) but only covers part of the main changeset, as it omits the pygments pinning in pyproject.toml which is a key part of the PR objectives.
Description check ✅ Passed The description clearly explains the purpose of pinning pygments==2.19.2 in the docs dependency group to work around a Pygments 2.20.0 bug, directly related to the pyproject.toml changes in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Use uv with --frozen to respect the uv.lock file, ensuring
reproducible doc builds with pinned dependency versions.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@github-actions

github-actions Bot commented Mar 30, 2026 •

Copy link
Copy Markdown
Contributor
All images — No significant size changes
Image Platform Old Size New Size Change
prairielearn/executor:df60cb07015f76d22b33b97a1fbf36af721866a1 linux/amd64 1288.89 MB 1288.89 MB 0.00%
prairielearn/executor:df60cb07015f76d22b33b97a1fbf36af721866a1 linux/arm64 1256.63 MB 1256.63 MB 0.00%
prairielearn/prairielearn:df60cb07015f76d22b33b97a1fbf36af721866a1 linux/amd64 1288.89 MB 1288.88 MB 0.00%
prairielearn/prairielearn:df60cb07015f76d22b33b97a1fbf36af721866a1 linux/arm64 1256.63 MB 1256.62 MB 0.00%
Bundle sizes — No significant size changes

No changes to bundle sizes.

Comment thread .readthedocs.yml
tools:
python: '3.13'
jobs:
pre_create_environment:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Install with uv to force usage of the lockfile in readthedocs.

@reteps reteps changed the title Pin pygments in docs dependency group Use uv and pin pygments in readthedocs Mar 30, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.readthedocs.yml (1)

10-12: Make uv bootstrap idempotent and deterministic.

The current .readthedocs.yml uses asdf plugin add uv without a guard (fails on reruns if plugin exists) and pins to latest (non-deterministic across builds). Pin a concrete version and guard the plugin add command.

♻️ Suggested update
-      - asdf plugin add uv
-      - asdf install uv latest
-      - asdf global uv latest
+      - asdf plugin add uv || true
+      - asdf install uv 0.9.0
+      - asdf global uv 0.9.0
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.readthedocs.yml around lines 10 - 12, The asdf steps using "asdf plugin add
uv", "asdf install uv latest", and "asdf global uv latest" are non-idempotent
and non-deterministic; change "asdf plugin add uv" to a guarded form that skips
adding if the uv plugin already exists, and replace "latest" with a pinned
concrete UV version (or a CI-provided UV_VERSION variable) for both the install
and global lines so builds are deterministic and rerunnable. Update the three
lines referencing "asdf plugin add uv", "asdf install uv latest", and "asdf
global uv latest" accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.readthedocs.yml:
- Around line 10-12: The asdf steps using "asdf plugin add uv", "asdf install uv
latest", and "asdf global uv latest" are non-idempotent and non-deterministic;
change "asdf plugin add uv" to a guarded form that skips adding if the uv plugin
already exists, and replace "latest" with a pinned concrete UV version (or a
CI-provided UV_VERSION variable) for both the install and global lines so builds
are deterministic and rerunnable. Update the three lines referencing "asdf
plugin add uv", "asdf install uv latest", and "asdf global uv latest"
accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2ded380e-8488-4589-a67f-ffebc849c1f7

📥 Commits

Reviewing files that changed from the base of the PR and between 6076dd0 and 9e8b7cc.

📒 Files selected for processing (1)
  • .readthedocs.yml

@reteps
reteps added this pull request to the merge queue Mar 30, 2026
Merged via the queue into master with commit cdf0182 Mar 30, 2026
24 checks passed
@reteps
reteps deleted the reteps/pin-pygments branch March 30, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Requires Python code changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants