Repository navigation
ci(docs): install uv from PyPI on Read the Docs - #446
Merged
Merged
Conversation
Read the Docs builds fail in pre_create_environment: asdf resolves and
downloads uv from GitHub releases, which the builders intermittently can't
reach ('No compatible versions available (uv [0-9])', then a 504 on the
download), on main as on PRs. Install uv with pip from PyPI instead, and run
it as 'python -m uv', which needs no asdf shim on PATH.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019U8u44xFH87Am2mNHVrimP
Reviewer's GuideConfigurationReplace asdf's GitHub-based uv installation with a PyPI install followed by an asdf reshim so Read the Docs can run uv during the build.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
The install step runs in the activated virtualenv, whose python has no uv, so 'python -m uv sync' failed there. Reshim asdf's python after installing uv, and call uv by name, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019U8u44xFH87Am2mNHVrimP
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".readthedocs.yml" line_range="24" />
<code_context>
+ - python -m pip install uv
create_environment:
- - uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
+ - python -m uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
install:
- - UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs
</code_context>
<issue_to_address>
**Docs build stops before synchronization**
When read the Docs uses its virtualenv's Python for the configured commands, `python -m uv venv` and `python -m uv sync` look for `uv` in that environment, where it is absent because it was installed before the environment was created; the docs build stops.
Use the `uv` executable installed by the pip command for both `venv` and `sync`, rather than invoking `python -m uv`.
Also at `.readthedocs.yml:26`.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: .readthedocs.yml:24
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #446 +/- ##
=======================================
Coverage 99.70% 99.70%
=======================================
Files 69 69
Lines 9537 9537
=======================================
Hits 9509 9509
Misses 28 28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Read the Docs builds currently fail before any docs code runs. This happens on
main(251eb41) as well as on PRs. The failure is inpre_create_environment, where asdf resolves and downloads uv from GitHub releases. RTD's builders can't always reach GitHub, and when they can't the build stops:This PR changes how uv gets onto the builder:
python -m pip install uv, which avoids GitHub entirely.asdf reshim python. RTD's Python comes from asdf, so theuvscript pip installs is only onPATHonce asdf regenerates its shims. The install step runs inside RTD's activated virtualenv, which has no uv of its own, so it falls through to that shim.uv venvandUV_PROJECT_ENVIRONMENT=... uv sync --frozen --group docsare exactly as before.The first version of this PR ran uv as
python -m uvinstead. That failed on RTD because inside the activated virtualenv,pythonis the virtualenv's own interpreter, which has no uv.Testing
pip install uv,asdf reshim python,uv venvanduv sync, all exiting 0, and then built the docs. asdf's GitHub download is no longer involved.prekon.readthedocs.ymlpasses, includingcheck yaml.Type of change
🤖 Generated with Claude Code
https://claude.ai/code/session_019U8u44xFH87Am2mNHVrimP
Summary by Sourcery
Update the Read the Docs environment setup to obtain uv from PyPI instead of GitHub so documentation builds remain reliable.
Bug Fixes:
Build: