Skip to content

Docs makefile/RTD: Use uv if installed - #120711

Merged
hugovk merged 4 commits into
python:mainfrom
hugovk:uv
Jun 23, 2024
Merged

Docs makefile/RTD: Use uv if installed#120711
hugovk merged 4 commits into
python:mainfrom
hugovk:uv

Conversation

@hugovk

@hugovkhugovk commented Jun 18, 2024

Copy link
Copy Markdown
Member

Like python/devguide#1320 and python/peps#3791.

Using uv to install dependencies is quicker than pip.

Locally, running make -C Doc clean-venv; time make -C Doc venv with no cache goes from 8.9s -> 2.4s:

  • pip: make -C Doc venv 4.81s user 1.52s system 71% cpu 8.896 total
  • uv: make -C Doc venv 0.91s user 1.00s system 81% cpu 2.345 total

And with a warm cache goes from 5.03s -> 0.08s:

  • pip: make -C Doc venv 3.47s user 0.82s system 85% cpu 5.033 total
  • uv: make -C Doc venv 0.02s user 0.07s system 109% cpu 0.080 total

On Read the Docs, it adds 2 seconds to install uv, and then cuts the docs build time from 199s -> 190s, about 7s reduction in all.

RTD+uv docs: https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-uv


📚 Documentation preview 📚: https://cpython-previews--120711.org.readthedocs.build/

@willingcwillingc 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.

Awesome @hugovk. This pattern would be worth sharing more broadly with the science community.

🚢

@hugovk
hugovk merged commit bc37ac7 into python:mainJun 23, 2024
@hugovk
hugovk deleted the uv branch June 23, 2024 19:23
@hugovkhugovk added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Jun 23, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @hugovk, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker bc37ac7b440b5e816f0b3915b830404290522603 3.12

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 23, 2024
(cherry picked from commit bc37ac7)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@bedevere-app

Copy link
Copy Markdown

GH-120922 is a backport of this pull request to the 3.13 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.13 bugs and security fixes label Jun 23, 2024
@bedevere-app

Copy link
Copy Markdown

GH-120923 is a backport of this pull request to the 3.12 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.12 only security fixes label Jun 23, 2024
hugovk added a commit to hugovk/cpython that referenced this pull request Jun 23, 2024
(cherry picked from commit bc37ac7)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
hugovk added a commit that referenced this pull request Jun 23, 2024
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
FFY00 added a commit to FFY00/cpython that referenced this pull request Jan 20, 2025
pythonGH-120711 introduced uv as an alternative venv provisioning and method,
but failed to honor the `PYTHON` variable, leading uv to the system's
default Python installation. Honoring `PYTHON` is important for use
cases such as `doctest`, which should run with the locally built Python.
Signed-off-by: Filipe Laíns <lains@riseup.net>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@hugovk@willingc