Skip to content

Cache python installs - #621

Merged
eifinger merged 7 commits into
astral-sh:mainfrom
merlinz01:cache-python-install-dir
Oct 9, 2025
Merged

Cache python installs#621
eifinger merged 7 commits into
astral-sh:mainfrom
merlinz01:cache-python-install-dir

Conversation

@merlinz01

@merlinz01 merlinz01 commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

This pull request introduces support for caching Python installs in the GitHub Action, allowing users to cache not only dependencies but also the Python interpreter itself.

This works by setting the UV_PYTHON_INSTALL_DIR to a subdirectory of the dependency cache path so that Python installs are directed there.

Fixes #135

@merlinz01
merlinz01 requested a review from eifinger as a code owner October 8, 2025 15:49
@merlinz01
merlinz01 force-pushed the cache-python-install-dir branch from d57dd8f to 215e68d Compare October 8, 2025 17:03

@eifinger eifinger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would rather not spread this functionality over the code if not necessary and avoid setting env vars.

We can also solve this by making use of the fact that cache.restoreCache and cache.saveCache accept more than one path.

Before running the actions determine if cachePython is true and then determine the pythonDir by capturing the output of uv python dir.

Also add another segment to the cache key to show if cachePython is set.

Finally lets also test this with a test in test.yml. e.g. Setting up the cache, restoring the cache and check if the required files are in the expected dir.

Comment thread README.md Outdated
Comment thread action.yml Outdated
Comment thread src/setup-uv.ts Outdated
@merlinz01
merlinz01 force-pushed the cache-python-install-dir branch 7 times, most recently from 92e3b5d to e4538f5 Compare October 9, 2025 14:40
@merlinz01

Copy link
Copy Markdown
Contributor Author

Almost ready, just need to figure out why the test is failing.

@merlinz01
merlinz01 force-pushed the cache-python-install-dir branch 2 times, most recently from a9a125f to a2f443f Compare October 9, 2025 15:52

@eifinger eifinger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see you are iterating to get the test to pass. Some comments that might help.

Comment thread .github/workflows/test.yml
Comment thread .github/workflows/test.yml
Comment thread .github/workflows/test.yml Outdated
Comment thread src/utils/inputs.ts
Comment thread src/utils/inputs.ts Outdated
Comment thread src/utils/inputs.ts Outdated
Comment thread .github/workflows/test.yml Outdated
@merlinz01
merlinz01 force-pushed the cache-python-install-dir branch from fe551dd to 08df9dc Compare October 9, 2025 20:17
Comment thread .github/workflows/test.yml Outdated
@merlinz01
merlinz01 force-pushed the cache-python-install-dir branch from 3d68f99 to c8d10d1 Compare October 9, 2025 20:31
@merlinz01
merlinz01 requested a review from eifinger October 9, 2025 20:34

@eifinger eifinger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks really nice. Great work. Thank you!

Small typo and we are good to go. But already leaving an approval. Will release this tomorrow.

Comment thread .github/workflows/test.yml Outdated
Co-authored-by: Kevin Stillhammer <kevin.stillhammer@gmail.com>
@eifinger eifinger added the enhancement New feature or request label Oct 9, 2025
@eifinger
eifinger merged commit 6d2eb15 into astral-sh:main Oct 9, 2025
82 checks passed
@merlinz01
merlinz01 deleted the cache-python-install-dir branch October 9, 2025 20:47
ulgens added a commit to ulgens/django-official-tutorial that referenced this pull request Oct 20, 2025
ulgens added a commit to ulgens/django-official-tutorial that referenced this pull request Oct 20, 2025
luketainton pushed a commit to luketainton/repos_pypilot that referenced this pull request Apr 16, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | action | major | `v7` → `v8.0.0` |

---

### Release Notes

<details>
<summary>astral-sh/setup-uv (astral-sh/setup-uv)</summary>

### [`v8.0.0`](https://github.com/astral-sh/setup-uv/releases/tag/v8.0.0): 🌈 Immutable releases and secure tags

[Compare Source](astral-sh/setup-uv@v7.6.0...v8.0.0)

### This is the first immutable release of `setup-uv` 🥳

All future releases are also immutable, if you want to know more about what this means checkout [the docs](https://docs.github.com/en/code-security/concepts/supply-chain-security/immutable-releases).

This release also has two breaking changes

#### New format for `manifest-file`

The previously deprecated way of defining a custom version manifest to control which `uv` versions are available and where to download them from got removed. The functionality is still there but you have to use the [new format](https://github.com/astral-sh/setup-uv/blob/main/docs/customization.md#format).

#### No more major and minor tags

To increase **security** even more we will **stop publishing minor tags**. You won't be able to use `@v8` or `@v8.0` any longer. We do this because pinning to major releases opens up users to supply chain attacks like what happened to [tj-actions](https://unit42.paloaltonetworks.com/github-actions-supply-chain-attack/).

> \[!TIP]
> Use the immutable tag as a version `astral-sh/setup-uv@v8.0.0`
> Or even better the githash `astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57`

#### 🚨 Breaking changes

- Remove update-major-minor-tags workflow [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;826](astral-sh/setup-uv#826))
- Remove deprecrated custom manifest [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;813](astral-sh/setup-uv#813))

#### 🧰 Maintenance

- Shortcircuit latest version from manifest [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;828](astral-sh/setup-uv#828))
- Simplify inputs.ts [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;827](astral-sh/setup-uv#827))
- Bump release-drafter to v7.1.1 [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;825](astral-sh/setup-uv#825))
- Refactor inputs [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;823](astral-sh/setup-uv#823))
- Replace inline compile args with tsconfig [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;824](astral-sh/setup-uv#824))
- chore: update known checksums for 0.11.2 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;821](astral-sh/setup-uv#821))
- chore: update known checksums for 0.11.1 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;817](astral-sh/setup-uv#817))
- chore: update known checksums for 0.11.0 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;815](astral-sh/setup-uv#815))
- Fix latest-version workflow check [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;812](astral-sh/setup-uv#812))
- chore: update known checksums for 0.10.11/0.10.12 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;811](astral-sh/setup-uv#811))

### [`v7.6.0`](https://github.com/astral-sh/setup-uv/releases/tag/v7.6.0): 🌈 Fetch uv from Astral's mirror by default

[Compare Source](astral-sh/setup-uv@v7.5.0...v7.6.0)

#### Changes

We now default to download uv from `releases.astral.sh`.
This means by default we don't hit the GitHub API at all and shouldn't see any rate limits and timeouts any more.

#### 🚀 Enhancements

- Fetch uv from Astral's mirror by default [@&#8203;zsol](https://github.com/zsol) ([#&#8203;809](astral-sh/setup-uv#809))

#### 🧰 Maintenance

- Switch to ESM for source and test, use CommonJS for dist [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;806](astral-sh/setup-uv#806))
- chore: update known checksums for 0.10.10 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;804](astral-sh/setup-uv#804))

#### ⬆️ Dependency updates

- chore(deps): bump zizmorcore/zizmor-action from 0.5.0 to 0.5.2 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;808](astral-sh/setup-uv#808))
- Bump deps [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;805](astral-sh/setup-uv#805))

### [`v7.5.0`](https://github.com/astral-sh/setup-uv/releases/tag/v7.5.0): 🌈 Use `astral-sh/versions` as version provider

[Compare Source](astral-sh/setup-uv@v7.4.0...v7.5.0)

### No more rate-limits

This release addresses a long-standing source of timeouts and rate-limit failures in setup-uv.

Previously, the action resolved version identifiers like 0.5.x by iterating over available uv releases via the GitHub API to find the best match. In contrast, latest and exact versions such as 0.5.0 skipped version resolution entirely and downloaded uv directly.

The `manifest-file` input was an earlier attempt to improve this. It allows providing an url to a file that lists available versions, checksums, and even custom download URLs. The action also shipped with such a manifest.
However, because that bundled file could become outdated whenever new uv releases were published, the action still had to fall back to the GitHub API in many cases.

This release solves the problem by sourcing version data from Astral’s versions repository via the raw content endpoint:

<https://raw.githubusercontent.com/astral-sh/versions/refs/heads/main/v1/uv.ndjson>

By using the raw endpoint instead of the GitHub API, version resolution no longer depends on API authentication and is much less likely to run into rate limits or timeouts.

***

> \[!TIP]
> The next section is only interesting for users of the `manifest-file` input

The `manifest-file` input lets you override that source with your own URL, for example to test custom uv builds or alternate download locations.

The manifest file must be in NDJSON format, where each line is a JSON object representing a version and its artifacts. For example:

```json
{"version":"0.10.7","artifacts":[{"platform":"x86_64-unknown-linux-gnu","variant":"default","url":"https://example.com/uv-x86_64-unknown-linux-gnu.tar.gz","archive_format":"tar.gz","sha256":"..."}]}
{"version":"0.10.6","artifacts":[{"platform":"x86_64-unknown-linux-gnu","variant":"default","url":"https://example.com/uv-x86_64-unknown-linux-gnu.tar.gz","archive_format":"tar.gz","sha256":"..."}]}
```

> \[!WARNING]\
> The old format still works but is deprecated. A warning will be logged when you use it.

#### Changes

- docs: replace copilot instructions with AGENTS.md [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;794](astral-sh/setup-uv#794))

#### 🚀 Enhancements

- Use astral-sh/versions as primary version provider [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;802](astral-sh/setup-uv#802))

#### 📚 Documentation

- docs: add cross-client dependabot rollup skill [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;793](astral-sh/setup-uv#793))

### [`v7.4.0`](https://github.com/astral-sh/setup-uv/releases/tag/v7.4.0): 🌈 Add riscv64 architecture support to platform detection

[Compare Source](astral-sh/setup-uv@v7.3.1...v7.4.0)

#### Changes

Thank you [@&#8203;luhenry](https://github.com/luhenry) for adding support for riscv64 arch

#### 🚀 Enhancements

- Add riscv64 architecture support to platform detection [@&#8203;luhenry](https://github.com/luhenry) ([#&#8203;791](astral-sh/setup-uv#791))

#### 🧰 Maintenance

- Delete .github/workflows/dependabot-build.yml [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;789](astral-sh/setup-uv#789))
- Harden Dependabot build workflow [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;788](astral-sh/setup-uv#788))
- Fix: check PR author instead of event sender for Dependabot detection [@&#8203;eifinger-bot](https://github.com/eifinger-bot) ([#&#8203;787](astral-sh/setup-uv#787))
- chore: update known checksums for 0.10.9 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;783](astral-sh/setup-uv#783))
- Add workflow to auto-build dist on Dependabot PRs [@&#8203;eifinger-bot](https://github.com/eifinger-bot) ([#&#8203;782](astral-sh/setup-uv#782))
- chore: update known checksums for 0.10.8 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;779](astral-sh/setup-uv#779))
- chore: update known checksums for 0.10.7 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;775](astral-sh/setup-uv#775))

#### ⬆️ Dependency updates

- chore(deps): bump versions [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;792](astral-sh/setup-uv#792))
- Bump actions/setup-node from 6.2.0 to 6.3.0 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;790](astral-sh/setup-uv#790))
- Bump eifinger/actionlint-action from 1.10.0 to 1.10.1 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;778](astral-sh/setup-uv#778))

### [`v7.3.1`](https://github.com/astral-sh/setup-uv/releases/tag/v7.3.1): 🌈 fall back to VERSION_CODENAME when VERSION_ID is not available

[Compare Source](astral-sh/setup-uv@v7.3.0...v7.3.1)

#### Changes

This release adds support for running in containers like `debian:testing` or `debian:unstable`

#### 🐛 Bug fixes

- fix: fall back to VERSION\_CODENAME when VERSION\_ID is not available [@&#8203;eifinger-bot](https://github.com/eifinger-bot) ([#&#8203;774](astral-sh/setup-uv#774))

#### 🧰 Maintenance

- chore: update known checksums for 0.10.6 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;771](astral-sh/setup-uv#771))
- chore: update known checksums for 0.10.5 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;770](astral-sh/setup-uv#770))
- chore: update known checksums for 0.10.4 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;768](astral-sh/setup-uv#768))
- chore: update known checksums for 0.10.3 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;767](astral-sh/setup-uv#767))
- chore: update known checksums for 0.10.2 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;765](astral-sh/setup-uv#765))
- chore: update known checksums for 0.10.1 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;764](astral-sh/setup-uv#764))

#### ⬆️ Dependency updates

- Bump github/codeql-action from 4.31.9 to 4.32.2 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;766](astral-sh/setup-uv#766))
- Bump zizmorcore/zizmor-action from 0.4.1 to 0.5.0 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;763](astral-sh/setup-uv#763))

### [`v7.3.0`](https://github.com/astral-sh/setup-uv/releases/tag/v7.3.0): 🌈 New features and bug fixes for activate-environment

[Compare Source](astral-sh/setup-uv@v7.2.1...v7.3.0)

#### Changes

This release contains a few bug fixes and a new feature for the activate-environment functionality.

#### 🐛 Bug fixes

- fix: warn instead of error when no python to cache [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;762](astral-sh/setup-uv#762))
- fix: use --clear to create venv [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;761](astral-sh/setup-uv#761))

#### 🚀 Enhancements

- feat: add venv-path input for activate-environment [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;746](astral-sh/setup-uv#746))

#### 🧰 Maintenance

- chore: update known checksums for 0.10.0 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;759](astral-sh/setup-uv#759))
- refactor: tilde-expansion tests as unittests and no self-hosted tests [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;760](astral-sh/setup-uv#760))
- chore: update known checksums for 0.9.30 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;756](astral-sh/setup-uv#756))
- chore: update known checksums for 0.9.29 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;748](astral-sh/setup-uv#748))

#### 📚 Documentation

- Fix punctuation [@&#8203;pm-dev563](https://github.com/pm-dev563) ([#&#8203;747](astral-sh/setup-uv#747))

#### ⬆️ Dependency updates

- Bump typesafegithub/github-actions-typing from 2.2.1 to 2.2.2 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;753](astral-sh/setup-uv#753))
- Bump peter-evans/create-pull-request from 8.0.0 to 8.1.0 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;751](astral-sh/setup-uv#751))
- Bump actions/checkout from 6.0.1 to 6.0.2 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;740](astral-sh/setup-uv#740))
- Bump release-drafter/release-drafter from 6.1.0 to 6.2.0 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;743](astral-sh/setup-uv#743))
- Bump eifinger/actionlint-action from 1.9.3 to 1.10.0 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;731](astral-sh/setup-uv#731))
- Bump actions/setup-node from 6.1.0 to 6.2.0 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;738](astral-sh/setup-uv#738))

### [`v7.2.1`](https://github.com/astral-sh/setup-uv/releases/tag/v7.2.1): 🌈 update known checksums up to 0.9.28

[Compare Source](astral-sh/setup-uv@v7.2.0...v7.2.1)

#### Changes

#### 🧰 Maintenance

- chore: update known checksums for 0.9.28 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;744](astral-sh/setup-uv#744))
- chore: update known checksums for 0.9.27 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;742](astral-sh/setup-uv#742))
- chore: update known checksums for 0.9.26 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;734](astral-sh/setup-uv#734))
- chore: update known checksums for 0.9.25 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;733](astral-sh/setup-uv#733))
- chore: update known checksums for 0.9.24 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;730](astral-sh/setup-uv#730))

#### 📚 Documentation

- Clarify impact of using actions/setup-python [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;732](astral-sh/setup-uv#732))

#### ⬆️ Dependency updates

- Bump zizmorcore/zizmor-action from 0.3.0 to 0.4.1 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;741](astral-sh/setup-uv#741))

### [`v7.2.0`](https://github.com/astral-sh/setup-uv/releases/tag/v7.2.0): 🌈 add outputs python-version and python-cache-hit

[Compare Source](astral-sh/setup-uv@v7.1.6...v7.2.0)

#### Changes

Among some minor typo fixes and quality of life features for developers of actions the main feature of this release are new outputs:

- **python-version:** The Python version that was set (same content as existing `UV_PYTHON`)
- **python-cache-hit:** A boolean value to indicate the Python cache entry was found

While implementing this it became clear, that it is easier to handle the Python binaries in a separate cache entry. The added benefit for users is that the "normal" cache containing the dependencies can be used in all runs no matter if these cache the Python binaries or not.

> \[!NOTE]\
> This release will invalidate caches that contain the Python binaries. This happens a single time.

#### 🐛 Bug fixes

- chore: remove stray space from UV\_PYTHON\_INSTALL\_DIR message [@&#8203;akx](https://github.com/akx) ([#&#8203;720](astral-sh/setup-uv#720))

#### 🚀 Enhancements

- add outputs python-version and python-cache-hit [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;728](astral-sh/setup-uv#728))
- Add action typings with validation [@&#8203;krzema12](https://github.com/krzema12) ([#&#8203;721](astral-sh/setup-uv#721))

#### 🧰 Maintenance

- fix: use uv\_build backend for old-python-constraint-project [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;729](astral-sh/setup-uv#729))
- chore: update known checksums for 0.9.22 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;727](astral-sh/setup-uv#727))
- chore: update known checksums for 0.9.21 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;726](astral-sh/setup-uv#726))
- chore: update known checksums for 0.9.20 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;725](astral-sh/setup-uv#725))
- chore: update known checksums for 0.9.18 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;718](astral-sh/setup-uv#718))

#### ⬆️ Dependency updates

- Bump peter-evans/create-pull-request from 7.0.9 to 8.0.0 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;719](astral-sh/setup-uv#719))
- Bump github/codeql-action from 4.31.6 to 4.31.9 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;723](astral-sh/setup-uv#723))

### [`v7.1.6`](https://github.com/astral-sh/setup-uv/releases/tag/v7.1.6): 🌈 add OS version to cache key to prevent binary incompatibility

[Compare Source](astral-sh/setup-uv@v7.1.5...v7.1.6)

#### Changes

This release will invalidate your cache existing keys!

The os version e.g. `ubuntu-22.04` is now part of the cache key. This prevents failing builds when a cache got populated with wheels built with different tools (e.g. glibc) than are present on the runner where the cache got restored.

#### 🐛 Bug fixes

- feat: add OS version to cache key to prevent binary incompatibility [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;716](astral-sh/setup-uv#716))

#### 🧰 Maintenance

- chore: update known checksums for 0.9.17 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;714](astral-sh/setup-uv#714))

#### ⬆️ Dependency updates

- Bump actions/checkout from 5.0.0 to 6.0.1 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;712](astral-sh/setup-uv#712))
- Bump actions/setup-node from 6.0.0 to 6.1.0 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;715](astral-sh/setup-uv#715))

### [`v7.1.5`](https://github.com/astral-sh/setup-uv/releases/tag/v7.1.5): 🌈 allow setting `cache-local-path` without `enable-cache: true`

[Compare Source](astral-sh/setup-uv@v7.1.4...v7.1.5)

#### Changes

[#&#8203;612](astral-sh/setup-uv#612) fixed a faulty behavior where this action set `UV_CACHE_DIR` even though `enable-cache` was `false`. It also fixed the cases were the cache dir is already configured in a settings file like `pyproject.toml` or `UV_CACHE_DIR` was already set.  Here the action shouldn't overwrite or set `UV_CACHE_DIR`.

These fixes introduced an unwanted behavior: You can still set `cache-local-path` but this action didn't do anything. This release fixes that.

You can now use `cache-local-path` to automatically set `UV_CACHE_DIR` even when `enable-cache` is `false` (or gets set to false by default e.g. on self-hosted runners)

```yaml
- name: This is now possible
  uses: astral-sh/setup-uv@v7
  with:
    enable-cache: false
    cache-local-path: "/path/to/cache"
```

#### 🐛 Bug fixes

- allow cache-local-path w/o enable-cache [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;707](astral-sh/setup-uv#707))

#### 🧰 Maintenance

- set biome files.maxSize to 2MiB [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;708](astral-sh/setup-uv#708))
- chore: update known checksums for 0.9.16 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;706](astral-sh/setup-uv#706))
- chore: update known checksums for 0.9.15 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;704](astral-sh/setup-uv#704))
- chore: use `npm ci --ignore-scripts` everywhere [@&#8203;woodruffw](https://github.com/woodruffw) ([#&#8203;699](astral-sh/setup-uv#699))
- chore: update known checksums for 0.9.14 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;700](astral-sh/setup-uv#700))
- chore: update known checksums for 0.9.13 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;694](astral-sh/setup-uv#694))
- chore: update known checksums for 0.9.12 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;693](astral-sh/setup-uv#693))
- chore: update known checksums for 0.9.11 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;688](astral-sh/setup-uv#688))

#### ⬆️ Dependency updates

- Bump peter-evans/create-pull-request from 7.0.8 to 7.0.9 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;695](astral-sh/setup-uv#695))
- bump dependencies [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;709](astral-sh/setup-uv#709))
- Bump github/codeql-action from 4.30.9 to 4.31.6 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;698](astral-sh/setup-uv#698))
- Bump zizmorcore/zizmor-action from 0.2.0 to 0.3.0 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;696](astral-sh/setup-uv#696))
- Bump eifinger/actionlint-action from 1.9.2 to 1.9.3 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;690](astral-sh/setup-uv#690))

### [`v7.1.4`](https://github.com/astral-sh/setup-uv/releases/tag/v7.1.4): 🌈 Fix libuv closing bug on Windows

[Compare Source](astral-sh/setup-uv@v7.1.3...v7.1.4)

#### Changes

This release fixes the bug `Assertion failed: !(handle->flags & UV_HANDLE_CLOSING)` on Windows runners

#### 🐛 Bug fixes

- Wait 50ms before exit to fix libuv bug [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;689](astral-sh/setup-uv#689))

#### 🧰 Maintenance

- chore: update known checksums for 0.9.10 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;681](astral-sh/setup-uv#681))
- chore: update known checksums for 0.9.9 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;679](astral-sh/setup-uv#679))

### [`v7.1.3`](https://github.com/astral-sh/setup-uv/releases/tag/v7.1.3): 🌈 Support act

[Compare Source](astral-sh/setup-uv@v7.1.2...v7.1.3)

#### Changes

This bug fix release adds support for <https://github.com/nektos/act>
It was previously broken because of a too new `undici` version and TS transpilation target.

Compatibility with act is now automatically tested.

#### 🐛 Bug fixes

- use old undici and ES2022 target for act support [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;678](astral-sh/setup-uv#678))

#### 🧰 Maintenance

- chore: update known checksums for 0.9.8 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;677](astral-sh/setup-uv#677))
- chore: update known checksums for 0.9.7 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;671](astral-sh/setup-uv#671))
- chore: update known checksums for 0.9.6 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;670](astral-sh/setup-uv#670))

#### 📚 Documentation

- Correct description of `cache-dependency-glob` [@&#8203;allanlewis](https://github.com/allanlewis) ([#&#8203;676](astral-sh/setup-uv#676))

### [`v7.1.2`](https://github.com/astral-sh/setup-uv/releases/tag/v7.1.2): 🌈 Speed up extraction on Windows

[Compare Source](astral-sh/setup-uv@v7.1.1...v7.1.2)

#### Changes

[@&#8203;lazka](https://github.com/lazka) fixed a bug that caused extracting uv to take up to 30s. Thank you!

#### 🐛 Bug fixes

- Use tar for extracting the uv zip file on Windows too [@&#8203;lazka](https://github.com/lazka) ([#&#8203;660](astral-sh/setup-uv#660))

#### 🧰 Maintenance

- chore: update known checksums for 0.9.5 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;663](astral-sh/setup-uv#663))

#### ⬆️ Dependency updates

- Bump dependencies [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;664](astral-sh/setup-uv#664))
- Bump github/codeql-action from 4.30.8 to 4.30.9 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;652](astral-sh/setup-uv#652))

### [`v7.1.1`](https://github.com/astral-sh/setup-uv/releases/tag/v7.1.1): 🌈 Fix empty workdir detection and lowest resolution strategy

[Compare Source](astral-sh/setup-uv@v7.1.0...v7.1.1)

#### Changes

This release fixes a bug where the `working-directory` input was not used to detect an empty work dir. It also fixes the `lowest` resolution strategy resolving to latest when only a lower bound was specified.

Special thanks to [@&#8203;tpgillam](https://github.com/tpgillam) for the first contribution!

#### 🐛 Bug fixes

- Fix "lowest" resolution strategy with lower-bound only [@&#8203;tpgillam](https://github.com/tpgillam) ([#&#8203;649](astral-sh/setup-uv#649))
- Use working-directory to detect empty workdir [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;645](astral-sh/setup-uv#645))

#### 🧰 Maintenance

- chore: update known checksums for 0.9.4 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;651](astral-sh/setup-uv#651))
- chore: update known checksums for 0.9.3 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;644](astral-sh/setup-uv#644))

#### 📚 Documentation

- Change version in docs to v7 [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;647](astral-sh/setup-uv#647))

#### ⬆️ Dependency updates

- Bump github/codeql-action from 4.30.7 to 4.30.8 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;639](astral-sh/setup-uv#639))
- Bump actions/setup-node from 5.0.0 to 6.0.0 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;641](astral-sh/setup-uv#641))
- Bump eifinger/actionlint-action from 1.9.1 to 1.9.2 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;634](astral-sh/setup-uv#634))
- Update lockfile with latest npm [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;636](astral-sh/setup-uv#636))

### [`v7.1.0`](https://github.com/astral-sh/setup-uv/releases/tag/v7.1.0): 🌈 Support all the use cases

[Compare Source](astral-sh/setup-uv@v7...v7.1.0)

#### Changes

**Support all the use cases!!!**
... well, that we know of.

This release adds support for some use cases that most users don't encounter but are useful for e.g. people running Gitea.

The input `resolution-strategy` lets you use the lowest possible version of uv from a version range. Useful if you want to test your tool with different versions of uv.

If you use `activate-environment` the path to the activated venv is now also exposed under the output `venv`.

Downloaded python installations can now also be uploaded to the GitHub Actions cache backend. Useful if you are running in `act` and have configured your own backend and don't want to download python again, and again over a slow internet connection.

Finally the path to installed python interpreters is now added to the `PATH` on Windows.

#### 🚀 Enhancements

- Add resolution-strategy input to support oldest compatible version selection @&#8203;[copilot-swe-agent\[bot\]](https://github.com/apps/copilot-swe-agent) ([#&#8203;631](astral-sh/setup-uv#631))
- Add value of UV\_PYTHON\_INSTALL\_DIR to path [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;628](astral-sh/setup-uv#628))
- Set output venv when activate-environment is used [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;627](astral-sh/setup-uv#627))
- Cache python installs [@&#8203;merlinz01](https://github.com/merlinz01) ([#&#8203;621](astral-sh/setup-uv#621))

#### 🧰 Maintenance

- Add copilot-instructions.md [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;630](astral-sh/setup-uv#630))
- chore: update known checksums for 0.9.2 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;626](astral-sh/setup-uv#626))
- chore: update known checksums for 0.9.1 @&#8203;[github-actions\[bot\]](https://github.com/apps/github-actions) ([#&#8203;625](astral-sh/setup-uv#625))
- Fall back to PR for updating known versions [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;623](astral-sh/setup-uv#623))

#### 📚 Documentation

- Split up documentation [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;632](astral-sh/setup-uv#632))

#### ⬆️ Dependency updates

- Bump deps [@&#8203;eifinger](https://github.com/eifinger) ([#&#8203;633](astral-sh/setup-uv#633))
- Bump github/codeql-action from 3.30.6 to 4.30.7 @&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot) ([#&#8203;614](astral-sh/setup-uv#614))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMjQuMCIsInVwZGF0ZWRJblZlciI6IjQzLjEyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL2RlcGVuZGVuY2llcyJdfQ==-->

Reviewed-on: https://git.tainton.uk/repos/pypilot/pulls/433
Co-authored-by: renovate[bot] <renovate-bot@git.tainton.uk>
Co-committed-by: renovate[bot] <renovate-bot@git.tainton.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable caching Python installs also

2 participants