Skip to content

ci(docs): install uv from PyPI on Read the Docs - #446

Merged
steven-murray merged 3 commits into
mainfrom
fix/rtd-install-uv
Nov 8, 2026
Merged

steven-murray merged 3 commits into
mainfrom
fix/rtd-install-uv

Conversation

@steven-murray

@steven-murray steven-murray commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

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 in pre_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:

asdf install uv latest
No compatible versions available (uv [0-9])
...
* Downloading uv release 0.13.7...
curl: (22) The requested URL returned error: 504

This PR changes how uv gets onto the builder:

  • Install from PyPI. uv is installed with python -m pip install uv, which avoids GitHub entirely.
  • Reshim asdf. The step after it is asdf reshim python. RTD's Python comes from asdf, so the uv script pip installs is only on PATH once 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.
  • Build steps unchanged. uv venv and UV_PROJECT_ENVIRONMENT=... uv sync --frozen --group docs are exactly as before.

The first version of this PR ran uv as python -m uv instead. That failed on RTD because inside the activated virtualenv, python is the virtualenv's own interpreter, which has no uv.

Testing

  • This PR's RTD build: build 35735259 on 914d4f4 succeeded. It ran pip install uv, asdf reshim python, uv venv and uv sync, all exiting 0, and then built the docs. asdf's GitHub download is no longer involved.
  • Lint: prek on .readthedocs.yml passes, including check yaml.

Type of change

  • Maintenance (refactoring, CI, dependencies, etc.)

🤖 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:

  • Fix Read the Docs builds that fail when uv cannot be downloaded from GitHub releases.

Build:

  • Install uv from PyPI and refresh the asdf Python shims before running the existing documentation environment setup.

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
@sourcery-ai

sourcery-ai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Configuration

Replace 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.

  • .readthedocs.yml L20-24

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@steven-murray steven-murray added the type: ci Updates to CI (GH actions, RTD, etc.) label Nov 8, 2026 — with Claude
@github-actions github-actions Bot added the type: bug Something isn't working label Nov 8, 2026
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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .readthedocs.yml Resolved

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sourcery assessment

Approved.

@codecov

codecov Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.70%. Comparing base (132f513) to head (458119b).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@steven-murray
steven-murray merged commit a76c553 into main Nov 8, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something isn't working type: ci Updates to CI (GH actions, RTD, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants