Skip to content

More concise uv example #11946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions docs/user/build-customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -460,23 +460,22 @@ Take a look at the following example:

version: 2

sphinx:
configuration: docs/conf.py

build:
os: ubuntu-24.04
tools:
python: "3.13"
jobs:
create_environment:
post_system_dependencies:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- uv venv
create_environment:
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
install:
- uv pip install -r requirements.txt
build:
html:
- uv run sphinx-build -T -b html docs $READTHEDOCS_OUTPUT/html

MkDocs projects could use ``NO_COLOR=1 uv run mkdocs build --strict --site-dir $READTHEDOCS_OUTPUT/html`` instead.
Comment on lines -476 to -479
Copy link
Member

Choose a reason for hiding this comment

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

Seems this is removing the build step completely?

Copy link
Author

Choose a reason for hiding this comment

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

It's no longer overriding the build step because it doesn't need to, since uv is installing things in the regular RTD virtualenv. Here's a screenshot of a real run of this (from canonical/starbase#330):

image

Copy link
Author

Choose a reason for hiding this comment

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

And the full build log: starbase-build-log.txt

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

This example still isn't really a common uv use case though? I think we want to show people how to use uv in a way that makes it really clear what the steps are?

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure why this wouldn't be a common uv case? This is using uv's project management and lock file, where the previous example uses uv as a drop-in replacement for pip but doesn't use uv.lock This also matches quite well to the poetry steps above the example.

- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs

Update Conda version
~~~~~~~~~~~~~~~~~~~~
Expand Down