Releases: astral-sh/setup-uv
v5.1.0 🌈 Fewer cache invalidations
Changes
This release includes less frequently invalidated caches and a fix for setting the correct VIRTUAL_ENV
🐛 Bug fixes
🚀 Enhancements
📚 Documentation
v5.0.1 🌈 The christmas elves overlooked something
Changes
With so many breaking changes so close to the end of the year we missed something.
Thank you @ryanhiebert for quickly reporting that our new defaults fail the workflow if neither a uv.lock
nor a requirements*.txt
can be found. This is now a warning instead.
🐛 Bug fixes
v5.0.0 🎄 Merry Christmas - Help fastly and users by default
Changes
This christmans 🎄 release is a bit early bit still full of presents 🎁
Since we are changing some of the defaults this can lead to breaking changes, thus the major version increase.
Here are the highlights:
Default to enable-cache: true on GitHub hosted runners
Did you know that that Fastly, the company hosting PyPI, theoretically has to pay $12.5 million per month and so far have served more than 2.41 exabytes of data?
This is why they asked us to turn on caching by default. After weighting the pros and cons we decided to automatically upload the cache to the GitHub Actions cache when running on GitHub hosted runners. You can still disable that with enable-cache: false
.
I remember when I first got into actions and didn't understand all the magic. I was baffled that some actions did something behind the scenes to make everything faster. I hope with this change we help a lot of users who are don't want to or are afraid to understand what enable-cache
does.
Add **/requirements*.txt to default cache-dependency-glob
If caching is enabled we automatically searched for a uv.lock
file and when this changed we knew we had to refresh the cache. A lot of projects don't use this but rather the good old requirements.txt
. We now automatically search for both uv.lock
and requirements*.txt
(this means also requirements-test.txt
, requirements-dev.txt
, ...) files.
You can change this with cache-dependency-glob
Auto activate venv when python-version is set
Some workflows install packages on the fly. This automatically works when using a python version that is already present on the runner. But if uv installs the version, e.g. because it is a free-threaded version or an old one, it is a standalone-build and installing packages "into the system" is not possible.
We now automatically create a new virtual environment with uv venv
and activate it for the rest of the workflow if python-version
is used. This means you can now do
- name: Install uv
uses: astral-sh/setup-uv@auto-environment
with:
python-version: 3.13t
- run: uv pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple cython
🚨 Breaking changes
- Default to enable-cache: true on GitHub hosted runners @eifinger (#193)
- Add **/requirements*.txt to default cache-dependency-glob @eifinger (#185)
🐛 Bug fixes
🚀 Enhancements
- Auto activate venv when python-version is set @eifinger (#194)
- Add python version to cache key @eifinger (#187)
🧰 Maintenance
- chore: update known checksums for 0.5.11 @github-actions (#198)
- chore: update known checksums for 0.5.10 @github-actions (#196)
- chore: update known checksums for 0.5.9 @github-actions (#195)
- chore: update known checksums for 0.5.8 @github-actions (#190)
- chore: update known checksums for 0.5.7 @github-actions (#183)
- chore: update known checksums for 0.5.6 @github-actions (#179)
📚 Documentation
⬆️ Dependency updates
- Bump @types/node from 22.10.1 to 22.10.2 @dependabot (#189)
- Update dependencies @eifinger (#186)
v4.2.0 🌈 Resolve latest version instead of downloading latest release
Changes
We got a frist contribution from @pollenjp!
Thanks to this we are now resolving the latest version and try to find it in the local cache instead of always downloading the latest release from the uv repository.
This new approach is not only more efficient, it also fixes a latent bug in the self-hosted runners tools cache and makes the code more maintainable.
Thank you @pollenjp!
🚀 Enhancements
🧰 Maintenance
v4.1.0 🌈 Set UV_PYTHON for your workflow
Changes
You can now use the input python-version
to set the environment variable UV_PYTHON
for the rest of your workflow.
This will override any python version specifications in pyproject.toml
and .python-version
- name: Install the latest version of uv and set the python version to 3.12
uses: astral-sh/setup-uv@v4
with:
python-version: "3.12"
You can combine this with a matrix to test multiple python versions:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
- name: Test with python ${{ matrix.python-version }}
run: uv run --frozen pytest
🚀 Enhancements
🧰 Maintenance
- Reduce test matrices @eifinger (#173)
- chore: update known checksums for 0.5.5 @github-actions (#170)
- Speed up updating known checksums @eifinger (#166)
📚 Documentation
v4.0.0 🌈 Fail when cache local path does not exist when trying to cache
🚨 Breaking change 🚨
By default, the action will now fail if caching is enabled but there is nothing to upload (the uv cache directory does not exist).
If you want to ignore this, set the ignore-nothing-to-cache
input to true
.
- name: Ignore nothing to cache
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
ignore-nothing-to-cache: true
In previous releases only an error got logged when saving the cache failed. In most cases users did not realize something was wrong with their config.
Changes
🚨 Breaking changes
🐛 Bug fixes
- Fail when cache local path does not exist when trying to cache @eifinger (#163)
- Remove working dir from cacheDependencyGlob error message @eifinger (#162)
📚 Documentation
v3.2.4 🌈 Expand `~` tilde in input paths
This release adds support for expanding the ~
character to the user's home directory for the following inputs:
cache-local-path
tool-dir
tool-bin-dir
cache-dependency-glob
- name: Expand the tilde character
uses: astral-sh/setup-uv@v3
with:
cache-local-path: "~/path/to/cache"
tool-dir: "~/path/to/tool/dir"
tool-bin-dir: "~/path/to/tool-bin/dir"
cache-dependency-glob: "~/my-cache-buster"
In order to make this work cache-dependency-glob
also got support to glob files outside the working directory:
- name: Define an absolute cache dependency glob
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "/tmp/my-folder/requirements*.txt"
Thank you @fynnsu for raising this issue!
🚀 Enhancements
🧰 Maintenance
- chore: update known checksums for 0.5.4 @github-actions (#158)
- chore: update known checksums for 0.5.3 @github-actions (#156)
⬆️ Dependency updates
- Bump @types/node from 22.9.0 to 22.9.1 @dependabot (#157)
- Bump @vercel/ncc from 0.38.2 to 0.38.3 @dependabot (#155)
v3.2.3 🌈 update known checksums for 0.5.2
v3.2.2 🌈 Avoid leftover files by using temp dir
v3.2.1 🌈 Fix extracting with old PowerShell versions
Changes
Old PowerShell versions (5.1) have a problem with extracting files without the .zip
extension. To fix that we now make sure the extension is part of the filename.
🐛 Bug fixes
🧰 Maintenance
- chore: update known checksums for 0.4.30 @github-actions (#145)
- chore: update known checksums for 0.4.29 @github-actions (#140)
- chore: update known checksums for 0.4.28 @github-actions (#136)
⬆️ Dependency updates
- Bump @actions/cache from 3.2.4 to 3.3.0 @dependabot (#143)
- Bump @types/node from 22.8.6 to 22.9.0 @dependabot (#146)
- Bump @types/node from 22.7.9 to 22.8.6 @dependabot (#142)