Skip to content

Commit

Permalink
Update RTD config to use 'uv' for faster builds
Browse files Browse the repository at this point in the history
Using `build.commands`, we completely override the build process for
RTD. Per their documentation (linked in a comment), this is the
way to convert a doc build to use `uv`.

The install is done using the `uv pip` interface, which has a few
advantages:
- it can be treated as a plug-in replacement for `pip ...`
- it supports `-r` options (so we don't need to change how we're
  locking dependencies here)
- it ensures that we don't see any surprising new semantics from the
  uv lockfile (which could be hard to troubleshoot locally)

Because we're now using `build.commands`, there's no point in keeping
`jobs.pre_build` as separate config. Simply inline the relevant
command into our overridden process.
  • Loading branch information
sirosen committed Nov 5, 2024
1 parent 5e11def commit 55ec78a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ build:
os: "ubuntu-22.04"
tools:
python: "3.11"
jobs:
pre_build:
- bash ./scripts/rtd-pre-sphinx-build.sh

python:
install:
- method: pip
path: .
- requirements: "requirements/py3.11/docs.txt"
# use 'uv pip install' to apply build customization in a pip-compatible way
# see: https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-uv
commands:
- bash ./scripts/rtd-pre-sphinx-build.sh
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- uv pip install . -r "requirements/py3.11/docs.txt"
- uv run -m sphinx -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html

0 comments on commit 55ec78a

Please sign in to comment.