Skip to content

Releases: astral-sh/setup-uv

v5.1.0 🌈 Fewer cache invalidations

23 Dec 17:42
887a942
Compare
Choose a tag to compare

Changes

This release includes less frequently invalidated caches and a fix for setting the correct VIRTUAL_ENV

🐛 Bug fixes

🚀 Enhancements

📚 Documentation

  • Align use of actions/setup-python with uv docu @eifinger (#207)

v5.0.1 🌈 The christmas elves overlooked something

20 Dec 10:45
180f8b4
Compare
Choose a tag to compare

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

20 Dec 08:56
2af22b5
Compare
Choose a tag to compare

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?
image

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

🧰 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

v4.2.0 🌈 Resolve latest version instead of downloading latest release

30 Nov 18:16
38f3f10
Compare
Choose a tag to compare

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

  • Resolve latest version instead of downloading latest release @pollenjp (#178)

🧰 Maintenance

v4.1.0 🌈 Set UV_PYTHON for your workflow

28 Nov 20:51
5f42d5a
Compare
Choose a tag to compare

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

23 Nov 16:15
d8db0a8
Compare
Choose a tag to compare

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

image

Changes

🚨 Breaking changes

  • Fail when cache local path does not exist when trying to cache @eifinger (#163)

🐛 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

23 Nov 08:26
caf0cab
Compare
Choose a tag to compare

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

v3.2.3 🌈 update known checksums for 0.5.2

15 Nov 08:23
e779db7
Compare
Choose a tag to compare

Changes

🧰 Maintenance

  • chore: update known checksums for 0.5.2 @github-actions (#154)
  • chore: update known checksums for 0.5.1 @github-actions (#152)
  • chore: update known checksums for 0.5.0 @github-actions (#151)

v3.2.2 🌈 Avoid leftover files by using temp dir

06 Nov 11:55
2e657c1
Compare
Choose a tag to compare

Changes

The previous release left over downloaded files.

🐛 Bug fixes

v3.2.1 🌈 Fix extracting with old PowerShell versions

05 Nov 21:09
a7e1580
Compare
Choose a tag to compare

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