Compare commits

..

13 Commits

Author SHA1 Message Date
Zanie Blue
7cc9e96834 Add a Python architecture input 2026-09-30 11:26:40 -05:00
github-actions[bot]
bcf05803b5 chore: update known checksums for 0.12.20 (#1076)
chore: update known checksums for 0.12.20

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-29 13:06:23 +02:00
dependabot[bot]
b92a892142 chore(deps): bump zizmorcore/zizmor-action from 0.6.2 to 0.6.3 (#1077)
Bumps
[zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action)
from 0.6.2 to 0.6.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/zizmorcore/zizmor-action/releases">zizmorcore/zizmor-action's
releases</a>.</em></p>
<blockquote>
<h2>v0.6.3</h2>
<p>zizmor 1.30.0 is now the default version.</p>
<p>Release notes: <a
href="https://docs.zizmor.sh/release-notes/%5B#1300%5D(https://redirect.github.com/zizmorcore/zizmor-action/issues/1300)">zizmorcore/zizmor-action#1300</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="70fb788f84"><code>70fb788</code></a>
Sync zizmor versions (<a
href="https://redirect.github.com/zizmorcore/zizmor-action/issues/162">#162</a>)</li>
<li><a
href="7999d8c8ac"><code>7999d8c</code></a>
chore(deps): bump github/codeql-action/upload-sarif from 4.37.6 to
4.37.7 in ...</li>
<li><a
href="2ae1ce9c6b"><code>2ae1ce9</code></a>
chore(deps): bump github/codeql-action/upload-sarif (<a
href="https://redirect.github.com/zizmorcore/zizmor-action/issues/160">#160</a>)</li>
<li><a
href="951a5eef1c"><code>951a5ee</code></a>
Skip prerelease versions in sync-zizmor-versions workflow (<a
href="https://redirect.github.com/zizmorcore/zizmor-action/issues/158">#158</a>)</li>
<li><a
href="79f0191014"><code>79f0191</code></a>
chore(deps): bump github/codeql-action/upload-sarif (<a
href="https://redirect.github.com/zizmorcore/zizmor-action/issues/156">#156</a>)</li>
<li><a
href="26a3ae6758"><code>26a3ae6</code></a>
sync-zizmor-versions: retry up to 5 times (<a
href="https://redirect.github.com/zizmorcore/zizmor-action/issues/155">#155</a>)</li>
<li><a
href="435cb31ca9"><code>435cb31</code></a>
chore(deps): bump github/codeql-action/upload-sarif (<a
href="https://redirect.github.com/zizmorcore/zizmor-action/issues/151">#151</a>)</li>
<li><a
href="d6cec1055e"><code>d6cec10</code></a>
Try the new self-referencing syntax (<a
href="https://redirect.github.com/zizmorcore/zizmor-action/issues/148">#148</a>)</li>
<li><a
href="edd9b84a6a"><code>edd9b84</code></a>
README: bump pins (<a
href="https://redirect.github.com/zizmorcore/zizmor-action/issues/150">#150</a>)</li>
<li>See full diff in <a
href="3dc1ecc9bc...70fb788f84">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=zizmorcore/zizmor-action&package-manager=github_actions&previous-version=0.6.2&new-version=0.6.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-29 13:03:48 +02:00
github-actions[bot]
227a0f6bea chore: update known checksums for 0.12.19 (#1068)
chore: update known checksums for 0.12.19

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-25 08:48:57 +02:00
github-actions[bot]
525b679e45 chore: update known checksums for 0.12.18 (#1065)
chore: update known checksums for 0.12.18

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-23 08:08:47 +02:00
Kevin Stillhammer
c18668ad3c chore(deps): roll up Dependabot updates (#1059)
Co-authored-by: Amp <amp@ampcode.com>
2026-09-21 08:40:50 +02:00
github-actions[bot]
ffe1476305 chore: update known checksums for 0.12.17 (#1058)
chore: update known checksums for 0.12.17

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-20 10:50:13 +02:00
github-actions[bot]
f5548c5552 chore: update known checksums for 0.12.16 (#1057)
chore: update known checksums for 0.12.16

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-18 08:48:58 +02:00
Kevin Stillhammer
a761a4e9af Disable automatic cache saves for merge queues (#1056)
Amp-Thread-ID:
https://ampcode.com/threads/T-01a0af68-f950-77dc-b9ae-9402987584c8

Closes: #1052

Co-authored-by: Amp <amp@ampcode.com>
2026-09-17 15:56:38 +02:00
github-actions[bot]
3377a30666 chore: update known checksums for 0.12.15 (#1054)
chore: update known checksums for 0.12.15

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-16 08:10:10 +02:00
github-actions[bot]
dfb5f38677 chore: update known checksums for 0.12.14 (#1053)
chore: update known checksums for 0.12.14

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-15 07:41:36 +02:00
github-actions[bot]
45c121f982 chore: update known checksums for 0.12.13 (#1045)
chore: update known checksums for 0.12.13

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-11 08:30:39 +02:00
github-actions[bot]
8073452fd4 docs: update version references to v10.1.0 (#1044)
Update `uses: astral-sh/setup-uv@...` references in documentation to
`bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0`.

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-10 21:27:24 +02:00
24 changed files with 2466 additions and 1587 deletions

View File

@@ -47,7 +47,7 @@ jobs:
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 uses: github/codeql-action/init@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
source-root: src source-root: src
@@ -59,7 +59,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below) # If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 uses: github/codeql-action/autobuild@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
# ℹ️ Command-line programs to run using the OS shell. # ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl # 📚 https://git.io/JvXDl
@@ -73,4 +73,4 @@ jobs:
# make release # make release
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 uses: github/codeql-action/analyze@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7

View File

@@ -27,7 +27,7 @@ jobs:
- name: Actionlint - name: Actionlint
uses: eifinger/actionlint-action@1fc89649be682d16ec5cf65ea16e269eb88d3982 # v1.10.2 uses: eifinger/actionlint-action@1fc89649be682d16ec5cf65ea16e269eb88d3982 # v1.10.2
- name: Run zizmor - name: Run zizmor
uses: zizmorcore/zizmor-action@3dc1ecc9bcb9e94e9b2c709687979e1298497054 # v0.6.2 uses: zizmorcore/zizmor-action@70fb788f84895a7701f5643d103d587e460b5c99 # v0.6.3
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with: with:
node-version-file: .nvmrc node-version-file: .nvmrc

View File

@@ -15,6 +15,7 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs
- [Inputs](#inputs) - [Inputs](#inputs)
- [Outputs](#outputs) - [Outputs](#outputs)
- [Python version](#python-version) - [Python version](#python-version)
- [Python architecture](#python-architecture)
- [Working directory](#working-directory) - [Working directory](#working-directory)
- [Advanced Configuration](#advanced-configuration) - [Advanced Configuration](#advanced-configuration)
- [How it works](#how-it-works) - [How it works](#how-it-works)
@@ -26,7 +27,7 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs
```yaml ```yaml
- name: Install the latest version of uv - name: Install the latest version of uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
``` ```
If you do not specify a version, this action will look for a [required-version](https://docs.astral.sh/uv/reference/settings/#required-version) If you do not specify a version, this action will look for a [required-version](https://docs.astral.sh/uv/reference/settings/#required-version)
@@ -42,7 +43,7 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
```yaml ```yaml
- name: Install uv with all available options - name: Install uv with all available options
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
# The version of uv to install, e.g., "0.5.0", "latest", or "latest-known" (default: searches for version in config files, then latest) # The version of uv to install, e.g., "0.5.0", "latest", or "latest-known" (default: searches for version in config files, then latest)
version: "" version: ""
@@ -56,6 +57,9 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
# The version of Python to set UV_PYTHON to (overrides the Python version from .tool-versions) # The version of Python to set UV_PYTHON to (overrides the Python version from .tool-versions)
python-version: "" python-version: ""
# The Python architecture to set UV_PYTHON_ARCH to, e.g., x86_64 or aarch64
python-arch: ""
# Use uv venv to activate a venv ready to be used by later steps # Use uv venv to activate a venv ready to be used by later steps
activate-environment: "false" activate-environment: "false"
@@ -90,8 +94,8 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
# Whether to restore the cache if found # Whether to restore the cache if found
restore-cache: "true" restore-cache: "true"
# Whether to save the cache after the run # Whether to save the cache after the run: true, false, or auto (disabled for merge_group events)
save-cache: "true" save-cache: "auto"
# Suffix for the cache key # Suffix for the cache key
cache-suffix: "" cache-suffix: ""
@@ -157,7 +161,7 @@ python 3.13
``` ```
```yaml ```yaml
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 - uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version-file: ".tool-versions" version-file: ".tool-versions"
``` ```
@@ -168,7 +172,7 @@ a warning.
```yaml ```yaml
- name: Install the latest version of uv and set the python version to 3.13t - name: Install the latest version of uv and set the python version to 3.13t
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
python-version: 3.13t python-version: 3.13t
- run: uv pip install --python=3.13t pip - run: uv pip install --python=3.13t pip
@@ -186,13 +190,32 @@ jobs:
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Install the latest version of uv and set the python version - name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Test with python ${{ matrix.python-version }} - name: Test with python ${{ matrix.python-version }}
run: uv run --frozen pytest run: uv run --frozen pytest
``` ```
### Python architecture
Use `python-arch` to set `UV_PYTHON_ARCH` for the rest of the job. This selects the Python
architecture independently of the version, including versions requested by `.python-version`.
An explicit architecture or interpreter path in a Python request takes precedence.
```yaml
- uses: astral-sh/setup-uv@main
with:
python-version: "3.14"
python-arch: x86_64
- run: uv run --frozen pytest
```
The input overrides an existing `UV_PYTHON_ARCH` value. When it is omitted, the action respects
`UV_PYTHON_ARCH` from the environment. Both forms require a uv version that supports the variable;
the action reports an error if the installed version does not support it. The selected architecture
is included in the [cache key](docs/caching.md#cache-key).
### Working directory ### Working directory
You can set the working directory with the `working-directory` input. You can set the working directory with the `working-directory` input.
@@ -203,7 +226,7 @@ It also controls where [the venv gets created](#activate-environment), unless `v
```yaml ```yaml
- name: Install uv based on the config files in the working-directory - name: Install uv based on the config files in the working-directory
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
working-directory: my/subproject/dir working-directory: my/subproject/dir
``` ```
@@ -245,7 +268,7 @@ For example:
- name: Checkout the repository - name: Checkout the repository
uses: actions/checkout@main uses: actions/checkout@main
- name: Install the latest version of uv - name: Install the latest version of uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
- name: Test - name: Test
@@ -257,7 +280,7 @@ To install a specific version of Python, use
```yaml ```yaml
- name: Install the latest version of uv - name: Install the latest version of uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
- name: Install Python 3.12 - name: Install Python 3.12
@@ -276,7 +299,7 @@ output:
uses: actions/checkout@main uses: actions/checkout@main
- name: Install the default version of uv - name: Install the default version of uv
id: setup-uv id: setup-uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
- name: Print the installed version - name: Print the installed version
run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}" run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
``` ```

View File

@@ -1,9 +1,20 @@
import { beforeEach, describe, expect, it, jest } from "@jest/globals"; import {
afterEach,
beforeEach,
describe,
expect,
it,
jest,
} from "@jest/globals";
import { createSetupInputs } from "../helpers/setup-inputs"; import { createSetupInputs } from "../helpers/setup-inputs";
const mockRestoreCache = jest.fn(); const mockRestoreCache = jest.fn();
const mockSaveState = jest.fn(); const mockSaveState = jest.fn();
const mockSetOutput = jest.fn(); const mockSetOutput = jest.fn();
const mockGetArch = jest.fn(() => "x86_64");
const mockGetOSNameVersion = jest.fn(() => "ubuntu-24.04");
const mockGetPlatform = jest.fn(async () => "unknown-linux-gnu");
const ORIGINAL_UV_PYTHON_ARCH = process.env.UV_PYTHON_ARCH;
jest.unstable_mockModule("@actions/cache", () => ({ jest.unstable_mockModule("@actions/cache", () => ({
restoreCache: mockRestoreCache, restoreCache: mockRestoreCache,
@@ -24,9 +35,9 @@ jest.unstable_mockModule("../../src/utils/logging", () => ({
})); }));
jest.unstable_mockModule("../../src/utils/platforms", () => ({ jest.unstable_mockModule("../../src/utils/platforms", () => ({
getArch: jest.fn(() => "x86_64"), getArch: mockGetArch,
getOSNameVersion: jest.fn(() => "ubuntu-24.04"), getOSNameVersion: mockGetOSNameVersion,
getPlatform: jest.fn(async () => "unknown-linux-gnu"), getPlatform: mockGetPlatform,
})); }));
const { restoreCache } = await import("../../src/cache/restore-cache"); const { restoreCache } = await import("../../src/cache/restore-cache");
@@ -38,7 +49,19 @@ function cacheKeyOutput(): string {
} }
beforeEach(() => { beforeEach(() => {
delete process.env.UV_PYTHON_ARCH;
jest.clearAllMocks(); jest.clearAllMocks();
mockGetArch.mockReturnValue("x86_64");
mockGetOSNameVersion.mockReturnValue("ubuntu-24.04");
mockGetPlatform.mockResolvedValue("unknown-linux-gnu");
});
afterEach(() => {
if (ORIGINAL_UV_PYTHON_ARCH === undefined) {
delete process.env.UV_PYTHON_ARCH;
} else {
process.env.UV_PYTHON_ARCH = ORIGINAL_UV_PYTHON_ARCH;
}
}); });
describe("restoreCache", () => { describe("restoreCache", () => {
@@ -71,4 +94,39 @@ describe("restoreCache", () => {
"setup-uv-2-x86_64-unknown-linux-gnu-ubuntu-24.04-3.11-dependencyhash-tests-3.11", "setup-uv-2-x86_64-unknown-linux-gnu-ubuntu-24.04-3.11-dependencyhash-tests-3.11",
); );
}); });
it("includes an inherited Python architecture in the cache key", async () => {
process.env.UV_PYTHON_ARCH = "aarch64";
await restoreCache(createSetupInputs(), "3.14");
expect(cacheKeyOutput()).toContain("-3.14-python-aarch64-");
});
it.each(["aarch64", "x86_64"])(
"separates %s Python caches on a Windows ARM64 runner",
async (pythonArch) => {
mockGetArch.mockReturnValue("aarch64");
mockGetOSNameVersion.mockReturnValue("windows-11");
mockGetPlatform.mockResolvedValue("pc-windows-msvc");
const inputs = createSetupInputs({
cachePython: true,
pythonArch,
restoreCache: true,
});
await restoreCache(inputs, "3.14");
const cacheKey = `setup-uv-2-aarch64-pc-windows-msvc-windows-11-3.14-python-${pythonArch}-py-dependencyhash`;
expect(cacheKeyOutput()).toBe(cacheKey);
expect(mockRestoreCache).toHaveBeenCalledWith(
[inputs.cacheLocalPath?.path],
cacheKey,
);
expect(mockRestoreCache).toHaveBeenCalledWith(
[inputs.pythonDir],
`${cacheKey}-python`,
);
},
);
}); });

View File

@@ -21,6 +21,7 @@ export function createSetupInputs(
ignoreNothingToCache: false, ignoreNothingToCache: false,
noProject: false, noProject: false,
pruneCache: false, pruneCache: false,
pythonArch: "",
pythonDir: "/tmp/uv-python-dir", pythonDir: "/tmp/uv-python-dir",
pythonVersion: "", pythonVersion: "",
quiet: false, quiet: false,

View File

@@ -19,6 +19,7 @@ const ORIGINAL_RUNNER_ENVIRONMENT = process.env.RUNNER_ENVIRONMENT;
const ORIGINAL_RUNNER_TEMP = process.env.RUNNER_TEMP; const ORIGINAL_RUNNER_TEMP = process.env.RUNNER_TEMP;
const ORIGINAL_UV_CACHE_DIR = process.env.UV_CACHE_DIR; const ORIGINAL_UV_CACHE_DIR = process.env.UV_CACHE_DIR;
const ORIGINAL_UV_PYTHON = process.env.UV_PYTHON; const ORIGINAL_UV_PYTHON = process.env.UV_PYTHON;
const ORIGINAL_UV_PYTHON_ARCH = process.env.UV_PYTHON_ARCH;
const ORIGINAL_UV_PYTHON_INSTALL_DIR = process.env.UV_PYTHON_INSTALL_DIR; const ORIGINAL_UV_PYTHON_INSTALL_DIR = process.env.UV_PYTHON_INSTALL_DIR;
const mockDebug = jest.fn(); const mockDebug = jest.fn();
@@ -37,7 +38,9 @@ jest.unstable_mockModule("@actions/core", () => ({
warning: mockWarning, warning: mockWarning,
})); }));
const { CacheLocalSource, loadInputs } = await import("../../src/utils/inputs"); const { CacheLocalSource, loadInputs, resolvePythonArch } = await import(
"../../src/utils/inputs"
);
function createTempProject(files: Record<string, string> = {}): string { function createTempProject(files: Record<string, string> = {}): string {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "setup-uv-inputs-test-")); const dir = fs.mkdtempSync(path.join(os.tmpdir(), "setup-uv-inputs-test-"));
@@ -62,6 +65,7 @@ function resetEnvironment(): void {
delete process.env.RUNNER_TEMP; delete process.env.RUNNER_TEMP;
delete process.env.UV_CACHE_DIR; delete process.env.UV_CACHE_DIR;
delete process.env.UV_PYTHON; delete process.env.UV_PYTHON;
delete process.env.UV_PYTHON_ARCH;
delete process.env.UV_PYTHON_INSTALL_DIR; delete process.env.UV_PYTHON_INSTALL_DIR;
} }
@@ -77,6 +81,11 @@ function restoreEnvironment(): void {
process.env.RUNNER_TEMP = ORIGINAL_RUNNER_TEMP; process.env.RUNNER_TEMP = ORIGINAL_RUNNER_TEMP;
process.env.UV_CACHE_DIR = ORIGINAL_UV_CACHE_DIR; process.env.UV_CACHE_DIR = ORIGINAL_UV_CACHE_DIR;
process.env.UV_PYTHON = ORIGINAL_UV_PYTHON; process.env.UV_PYTHON = ORIGINAL_UV_PYTHON;
if (ORIGINAL_UV_PYTHON_ARCH === undefined) {
delete process.env.UV_PYTHON_ARCH;
} else {
process.env.UV_PYTHON_ARCH = ORIGINAL_UV_PYTHON_ARCH;
}
process.env.UV_PYTHON_INSTALL_DIR = ORIGINAL_UV_PYTHON_INSTALL_DIR; process.env.UV_PYTHON_INSTALL_DIR = ORIGINAL_UV_PYTHON_INSTALL_DIR;
} }
@@ -98,6 +107,7 @@ describe("loadInputs", () => {
source: CacheLocalSource.Default, source: CacheLocalSource.Default,
}); });
expect(inputs.pythonDir).toBe("/runner-temp/uv-python-dir"); expect(inputs.pythonDir).toBe("/runner-temp/uv-python-dir");
expect(inputs.pythonArch).toBe("");
expect(inputs.venvPath).toBe("/workspace/.venv"); expect(inputs.venvPath).toBe("/workspace/.venv");
expect(inputs.manifestFile).toBeUndefined(); expect(inputs.manifestFile).toBeUndefined();
expect(inputs.resolutionStrategy).toBe("highest"); expect(inputs.resolutionStrategy).toBe("highest");
@@ -149,6 +159,28 @@ describe("loadInputs", () => {
expect(inputs.pythonVersion).toBe(""); expect(inputs.pythonVersion).toBe("");
}); });
it("prefers the python-arch input over UV_PYTHON_ARCH", () => {
mockInputs["working-directory"] = "/workspace";
mockInputs["python-arch"] = "x86_64";
process.env.UV_PYTHON_ARCH = "aarch64";
const inputs = loadInputs();
expect(inputs.pythonArch).toBe("x86_64");
expect(resolvePythonArch(inputs.pythonArch)).toBe("x86_64");
});
it.each(["aarch64", "x86_64_v3", ""])(
"uses UV_PYTHON_ARCH when python-arch is omitted: %s",
(pythonArch) => {
mockInputs["working-directory"] = "/workspace";
process.env.UV_PYTHON_ARCH = pythonArch;
const inputs = loadInputs();
expect(inputs.pythonArch).toBe("");
expect(resolvePythonArch(inputs.pythonArch)).toBe(pythonArch);
},
);
it.each(["pull_request_target", "workflow_run", "release"])( it.each(["pull_request_target", "workflow_run", "release"])(
"disables automatic caching for the %s event", "disables automatic caching for the %s event",
(eventName) => { (eventName) => {
@@ -206,6 +238,51 @@ describe("loadInputs", () => {
expect(inputs.enableCache).toBe(true); expect(inputs.enableCache).toBe(true);
}); });
it("restores but does not save cache automatically for merge groups", () => {
mockInputs["working-directory"] = "/workspace";
mockInputs["enable-cache"] = "auto";
mockInputs["restore-cache"] = "true";
mockInputs["save-cache"] = "auto";
process.env.RUNNER_ENVIRONMENT = "github-hosted";
process.env.RUNNER_TEMP = "/runner-temp";
process.env.GITHUB_EVENT_NAME = "merge_group";
const inputs = loadInputs();
expect(inputs.enableCache).toBe(true);
expect(inputs.restoreCache).toBe(true);
expect(inputs.saveCache).toBe(false);
expect(mockInfo).toHaveBeenCalledWith(
"Cache saving is disabled for the merge_group event",
);
});
it.each([
["true", true],
["false", false],
])("honors save-cache %s for merge groups", (saveCacheInput, expected) => {
mockInputs["working-directory"] = "/workspace";
mockInputs["save-cache"] = saveCacheInput;
process.env.GITHUB_EVENT_NAME = "merge_group";
const inputs = loadInputs();
expect(inputs.saveCache).toBe(expected);
expect(mockInfo).not.toHaveBeenCalledWith(
"Cache saving is disabled for the merge_group event",
);
});
it("automatically saves cache for other events", () => {
mockInputs["working-directory"] = "/workspace";
mockInputs["save-cache"] = "auto";
process.env.GITHUB_EVENT_NAME = "push";
const inputs = loadInputs();
expect(inputs.saveCache).toBe(true);
});
it("uses cache-dir from pyproject.toml when present", () => { it("uses cache-dir from pyproject.toml when present", () => {
mockInputs["working-directory"] = createTempProject({ mockInputs["working-directory"] = createTempProject({
"pyproject.toml": `[project] "pyproject.toml": `[project]

View File

@@ -0,0 +1,152 @@
import { promisify } from "node:util";
import {
afterEach,
beforeEach,
describe,
expect,
it,
jest,
} from "@jest/globals";
const ORIGINAL_UV_PYTHON_ARCH = process.env.UV_PYTHON_ARCH;
const mockExecFile =
jest.fn<
(...args: unknown[]) => Promise<{
stdout: string;
stderr: string;
}>
>();
const mockExportVariable = jest.fn();
jest.unstable_mockModule("node:child_process", () => ({
execFile: Object.assign(mockExecFile, { [promisify.custom]: mockExecFile }),
}));
jest.unstable_mockModule("@actions/core", () => ({
exportVariable: mockExportVariable,
}));
jest.unstable_mockModule("../../src/utils/logging", () => ({
info: jest.fn(),
}));
const { setupPythonArch } = await import("../../src/utils/python-arch");
const supportedProbe = Object.assign(new Error("uv exited with code 2"), {
code: 2,
stderr:
"error: Failed to parse environment variable `UV_PYTHON_ARCH` with invalid value `setup-uv-probe`: Unknown architecture: setup-uv-probe\n",
});
const success = { stderr: "", stdout: "/cache\n" };
beforeEach(() => {
delete process.env.UV_PYTHON_ARCH;
jest.clearAllMocks();
mockExecFile
.mockReset()
.mockRejectedValueOnce(supportedProbe)
.mockResolvedValueOnce(success);
});
afterEach(() => {
if (ORIGINAL_UV_PYTHON_ARCH === undefined) {
delete process.env.UV_PYTHON_ARCH;
} else {
process.env.UV_PYTHON_ARCH = ORIGINAL_UV_PYTHON_ARCH;
}
});
describe("setupPythonArch", () => {
it("leaves Python selection alone without an architecture", async () => {
await setupPythonArch("/tools/uv", "");
expect(mockExecFile).not.toHaveBeenCalled();
expect(mockExportVariable).not.toHaveBeenCalled();
});
it("validates an inherited architecture without exporting it", async () => {
process.env.UV_PYTHON_ARCH = "aarch64";
await setupPythonArch("/tools/uv", "");
expect(mockExecFile).toHaveBeenNthCalledWith(
2,
"/tools/uv",
["--no-config", "cache", "dir"],
expect.objectContaining({
env: expect.objectContaining({ UV_PYTHON_ARCH: "aarch64" }),
}),
);
expect(mockExportVariable).not.toHaveBeenCalled();
expect(process.env.UV_PYTHON_ARCH).toBe("aarch64");
});
it.each(["/runner temp/uv", "C:\\runner temp\\uv.exe"])(
"validates and exports the architecture using the installed uv: %s",
async (uvPath) => {
await setupPythonArch(uvPath, "x86_64");
expect(mockExecFile).toHaveBeenNthCalledWith(
1,
uvPath,
["--no-config", "cache", "dir"],
expect.objectContaining({
encoding: "utf8",
env: expect.objectContaining({ UV_PYTHON_ARCH: "setup-uv-probe" }),
}),
);
expect(mockExecFile).toHaveBeenNthCalledWith(
2,
uvPath,
["--no-config", "cache", "dir"],
expect.objectContaining({
env: expect.objectContaining({ UV_PYTHON_ARCH: "x86_64" }),
}),
);
expect(mockExportVariable).toHaveBeenCalledWith(
"UV_PYTHON_ARCH",
"x86_64",
);
},
);
it("rejects uv versions that ignore UV_PYTHON_ARCH", async () => {
mockExecFile.mockReset().mockResolvedValue(success);
await expect(setupPythonArch("/tools/uv", "x86_64")).rejects.toThrow(
"The installed version of uv does not support UV_PYTHON_ARCH",
);
expect(mockExecFile).toHaveBeenCalledTimes(1);
expect(mockExportVariable).not.toHaveBeenCalled();
});
it("reports unexpected probe failures", async () => {
mockExecFile.mockReset().mockRejectedValue(
Object.assign(new Error("uv exited with code 2"), {
code: 2,
stderr: "error: unrelated configuration error\n",
}),
);
await expect(setupPythonArch("/tools/uv", "x86_64")).rejects.toThrow(
"Failed to check uv's support for UV_PYTHON_ARCH: error: unrelated configuration error",
);
expect(mockExportVariable).not.toHaveBeenCalled();
});
it("reports invalid architectures before exporting them", async () => {
mockExecFile
.mockReset()
.mockRejectedValueOnce(supportedProbe)
.mockRejectedValueOnce(
Object.assign(new Error("uv exited with code 2"), {
code: 2,
stderr: "error: Unknown architecture: invalid\n",
}),
);
await expect(setupPythonArch("/tools/uv", "invalid")).rejects.toThrow(
"Failed to set Python architecture to invalid: error: Unknown architecture: invalid",
);
expect(mockExportVariable).not.toHaveBeenCalled();
});
});

View File

@@ -7,6 +7,8 @@ inputs:
type: string type: string
python-version: python-version:
type: string type: string
python-arch:
type: string
activate-environment: activate-environment:
type: boolean type: boolean
venv-path: venv-path:
@@ -33,7 +35,11 @@ inputs:
restore-cache: restore-cache:
type: boolean type: boolean
save-cache: save-cache:
type: boolean type: enum
allowed-values:
- "true"
- "false"
- auto
cache-suffix: cache-suffix:
type: string type: string
cache-local-path: cache-local-path:

View File

@@ -12,6 +12,9 @@ inputs:
python-version: python-version:
description: "The version of Python to set UV_PYTHON to. Overrides the Python version from .tool-versions." description: "The version of Python to set UV_PYTHON to. Overrides the Python version from .tool-versions."
required: false required: false
python-arch:
description: "The Python architecture to set UV_PYTHON_ARCH to, e.g., x86_64 or aarch64. Overrides UV_PYTHON_ARCH."
required: false
activate-environment: activate-environment:
description: "Use uv venv to activate a venv ready to be used by later steps. " description: "Use uv venv to activate a venv ready to be used by later steps. "
default: "false" default: "false"
@@ -51,8 +54,8 @@ inputs:
description: "Whether to restore the cache if found." description: "Whether to restore the cache if found."
default: "true" default: "true"
save-cache: save-cache:
description: "Whether to save the cache after the run." description: "Whether to save the cache after the run. 'auto' disables saving for merge_group events."
default: "true" default: "auto"
cache-suffix: cache-suffix:
description: "Suffix for the cache key" description: "Suffix for the cache key"
required: false required: false

View File

@@ -1,5 +1,5 @@
{ {
"$schema": "https://biomejs.dev/schemas/2.5.8/schema.json", "$schema": "https://biomejs.dev/schemas/2.5.9/schema.json",
"assist": { "assist": {
"actions": { "actions": {
"source": { "source": {

598
dist/save-cache/index.cjs generated vendored
View File

@@ -63714,15 +63714,6 @@ function info2(msg) {
} }
var warning2 = warning; var warning2 = warning;
// src/cache/restore-cache.ts
var STATE_CACHE_KEY = "cache-key";
var STATE_CACHE_MATCHED_KEY = "cache-matched-key";
var STATE_PYTHON_CACHE_MATCHED_KEY = "python-cache-matched-key";
// src/utils/constants.ts
var STATE_UV_PATH = "uv-path";
var STATE_UV_VERSION = "uv-version";
// src/utils/inputs.ts // src/utils/inputs.ts
var import_node_fs4 = __toESM(require("node:fs"), 1); var import_node_fs4 = __toESM(require("node:fs"), 1);
var import_node_path = __toESM(require("node:path"), 1); var import_node_path = __toESM(require("node:path"), 1);
@@ -63908,57 +63899,111 @@ ${codeblock}`, options);
} }
}; };
// node_modules/smol-toml/dist/util.js
function indexOfNewline(str, start = 0) {
let idx = str.indexOf("\n", start);
if (str.charCodeAt(idx - 1) === 13)
idx--;
return idx;
}
function skipComment(ctx) {
for (; ctx.p < ctx.s.length; ctx.p++) {
let c = ctx.s.charCodeAt(ctx.p);
if (c === 10)
break;
if (c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) {
ctx.p++;
break;
}
if (c < 32 && c !== 9 || c === 127) {
throw new TomlError("control characters are not allowed in comments", {
toml: ctx.s,
ptr: ctx.p
});
}
}
}
function skipVoid(ctx, banNewLines, banComments) {
let c;
while (1) {
while ((c = ctx.s.charCodeAt(ctx.p)) === 32 || c === 9 || !banNewLines && (c === 10 || c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10))
ctx.p++;
if (banComments || c !== 35)
break;
skipComment(ctx);
}
}
function skipUntil(ctx, sep8, end) {
let ptr = ctx.p;
if (!end) {
ptr = indexOfNewline(ctx.s, ptr);
ctx.p = ptr < 0 ? ctx.s.length : ptr;
return;
}
for (; ctx.p < ctx.s.length; ctx.p++) {
let c = ctx.s.charCodeAt(ctx.p);
if (c === 35) {
skipComment(ctx);
} else if (c === end || c === sep8) {
return;
}
}
throw new TomlError("cannot find end of structure", {
toml: ctx.s,
ptr
});
}
// node_modules/smol-toml/dist/primitive.js // node_modules/smol-toml/dist/primitive.js
var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/; var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/; var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
var LEADING_ZERO = /^[+-]?0[0-9_]/; var LEADING_ZERO = /^[+-]?0[0-9_]/;
function parseString(str, ptr) { function parseString(ctx) {
let c = str[ptr++]; let start = ctx.p;
let c = ctx.s.charCodeAt(ctx.p++);
let first = c; let first = c;
let isLiteral = c === "'"; let isLiteral = c === 39;
let isMultiline = c === str[ptr] && c === str[ptr + 1]; let isMultiline = c === ctx.s.charCodeAt(ctx.p) && c === ctx.s.charCodeAt(ctx.p + 1);
if (isMultiline) { if (isMultiline) {
if (str[ptr += 2] === "\n") if ((c = ctx.s.charCodeAt(ctx.p += 2)) === 10)
ptr++; ctx.p++;
else if (str[ptr] === "\r" && str[ptr + 1] === "\n") else if (c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)
ptr += 2; ctx.p += 2;
} }
let parsed = ""; let parsed = "";
let sliceStart = ptr; let sliceStart = ctx.p;
let state3 = 0; let state3 = 0;
for (let i = ptr; i < str.length; i++) { for (; ctx.p < ctx.s.length; ctx.p++) {
c = str[i]; c = ctx.s.charCodeAt(ctx.p);
if (isMultiline && (c === "\n" || c === "\r" && str[i + 1] === "\n")) { if (isMultiline && (c === 10 || c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) {
state3 = state3 && 3; state3 = state3 && 3;
} else if (c < " " && c !== " " || c === "\x7F") { } else if (c < 32 && c !== 9 || c === 127) {
throw new TomlError("control characters are not allowed in strings", { throw new TomlError("control characters are not allowed in strings", {
toml: str, toml: ctx.s,
ptr: i ptr: ctx.p
}); });
} else if ((!state3 || state3 === 3) && c === first && (!isMultiline || str[i + 1] === first && str[i + 2] === first)) { } else if ((!state3 || state3 === 3) && c === first && (!isMultiline || ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first)) {
if (isMultiline) { if (isMultiline) {
if (str[i + 3] === first) if (ctx.s.charCodeAt(ctx.p + 3) === first)
i++; ctx.p++;
if (str[i + 3] === first) if (ctx.s.charCodeAt(ctx.p + 3) === first)
i++; ctx.p++;
} }
return [ if (!state3)
// If we're in a newline escape still, then there's nothing to add. parsed += ctx.s.slice(sliceStart, ctx.p);
// Also try to avoid concat if there's nothing to add to parsed, or nothing has been added to parsed. ctx.p += isMultiline ? 3 : 1;
state3 ? parsed : parsed + str.slice(sliceStart, i), return parsed;
i + (isMultiline ? 3 : 1)
];
} else if (!state3) { } else if (!state3) {
if (!isLiteral && c === "\\") { if (!isLiteral && c === 92) {
parsed += str.slice(sliceStart, sliceStart = i); parsed += ctx.s.slice(sliceStart, sliceStart = ctx.p);
state3 = 1; state3 = 1;
} }
} else if (state3 === 1) { } else if (state3 === 1) {
if (c === "x" || c === "u" || c === "U") { if (c === 120 || c === 117 || c === 85) {
let value = 0; let value = 0;
let len = c === "x" ? 2 : c === "u" ? 4 : 8; let len = c === 120 ? 2 : c === 117 ? 4 : 8;
for (let j = 0; j < len; j++, i++) { for (let j = 0; j < len; j++, ctx.p++) {
let hex = str.charCodeAt(i + 1); let hex = ctx.s.charCodeAt(ctx.p + 1);
let digit = ( let digit = (
/* 0-9 */ /* 0-9 */
hex >= 48 && hex <= 57 ? hex - 48 : ( hex >= 48 && hex <= 57 ? hex - 48 : (
@@ -63970,57 +64015,68 @@ function parseString(str, ptr) {
) )
); );
if (digit < 0) if (digit < 0)
throw new TomlError("invalid non-hex character in unicode escape", { toml: str, ptr: i + 1 }); throw new TomlError("invalid non-hex character in unicode escape", { toml: ctx.s, ptr: ctx.p + 1 });
value = value << 4 | digit; value = value << 4 | digit;
} }
if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) { if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) {
throw new TomlError("invalid unicode escape", { toml: str, ptr: i }); throw new TomlError("invalid unicode escape", { toml: ctx.s, ptr: ctx.p });
} }
parsed += String.fromCodePoint(value); parsed += String.fromCodePoint(value);
sliceStart = i + 1; sliceStart = ctx.p + 1;
state3 = 0; state3 = 0;
} else if (c === " " || c === " ") { } else if (c === 32 || c === 9) {
state3 = 2; state3 = 2;
} else { } else {
if (c === "b") if (c === 98)
parsed += "\b"; parsed += "\b";
else if (c === "t") else if (c === 116)
parsed += " "; parsed += " ";
else if (c === "n") else if (c === 110)
parsed += "\n"; parsed += "\n";
else if (c === "f") else if (c === 102)
parsed += "\f"; parsed += "\f";
else if (c === "r") else if (c === 114)
parsed += "\r"; parsed += "\r";
else if (c === "e") else if (c === 101)
parsed += "\x1B"; parsed += "\x1B";
else if (c === '"') else if (c === 34)
parsed += '"'; parsed += '"';
else if (c === "\\") else if (c === 92)
parsed += "\\"; parsed += "\\";
else else
throw new TomlError("unrecognized escape sequence", { toml: str, ptr: i }); throw new TomlError("unrecognized escape sequence", { toml: ctx.s, ptr: ctx.p });
sliceStart = i + 1; sliceStart = ctx.p + 1;
state3 = 0; state3 = 0;
} }
} else if (c !== " " && c !== " ") { } else if (c !== 32 && c !== 9) {
if (state3 === 2) { if (state3 === 2) {
throw new TomlError("invalid escape: only line-ending whitespace may be escaped", { throw new TomlError("invalid escape: only line-ending whitespace may be escaped", {
toml: str, toml: ctx.s,
ptr: sliceStart ptr: sliceStart
}); });
} }
state3 = !isLiteral && c === "\\" ? 1 : 0; state3 = !isLiteral && c === 92 ? 1 : 0;
sliceStart = i; sliceStart = ctx.p;
} }
} }
throw new TomlError("unfinished string", { toml: str, ptr }); throw new TomlError("unfinished string", { toml: ctx.s, ptr: start });
} }
function parseValue2(value, toml, ptr, integersAsBigInt) { function sliceAndTrimEndOf(ctx, start, end) {
if (value === "true") let value = ctx.s.slice(start, end);
return true; let commentIdx = value.indexOf("#");
if (value === "false") if (commentIdx > 0) {
return false; skipComment({ s: value, p: commentIdx, d: 0 });
value = value.slice(0, commentIdx);
}
return value.trimEnd();
}
function parseValue2(ctx, integersAsBigInt, end) {
let ptr = ctx.p;
let err = { toml: ctx.s, ptr };
skipUntil(ctx, 44, end);
let value = sliceAndTrimEndOf(ctx, ptr, ctx.p);
if (!value)
throw new TomlError("incomplete declaration: value expected", err);
if (value === "-inf") if (value === "-inf")
return -Infinity; return -Infinity;
if (value === "inf" || value === "+inf") if (value === "inf" || value === "+inf")
@@ -64032,25 +64088,16 @@ function parseValue2(value, toml, ptr, integersAsBigInt) {
let isInt = INT_REGEX.test(value); let isInt = INT_REGEX.test(value);
if (isInt || FLOAT_REGEX.test(value)) { if (isInt || FLOAT_REGEX.test(value)) {
if (LEADING_ZERO.test(value)) { if (LEADING_ZERO.test(value)) {
throw new TomlError("leading zeroes are not allowed", { throw new TomlError("leading zeroes are not allowed", err);
toml,
ptr
});
} }
value = value.replace(/_/g, ""); value = value.replace(/_/g, "");
let numeric2 = +value; let numeric2 = +value;
if (isNaN(numeric2)) { if (isNaN(numeric2)) {
throw new TomlError("invalid number", { throw new TomlError("invalid number", err);
toml,
ptr
});
} }
if (isInt) { if (isInt) {
if ((isInt = !Number.isSafeInteger(numeric2)) && !integersAsBigInt) { if ((isInt = !Number.isSafeInteger(numeric2)) && !integersAsBigInt) {
throw new TomlError("integer value cannot be represented losslessly", { throw new TomlError("integer value cannot be represented losslessly", err);
toml,
ptr
});
} }
if (isInt || integersAsBigInt === true) if (isInt || integersAsBigInt === true)
numeric2 = BigInt(value); numeric2 = BigInt(value);
@@ -64058,279 +64105,184 @@ function parseValue2(value, toml, ptr, integersAsBigInt) {
return numeric2; return numeric2;
} }
const date = new TomlDate(value); const date = new TomlDate(value);
if (!date.isValid()) { if (!date.isValid())
throw new TomlError("invalid value", { throw new TomlError("invalid value", err);
toml,
ptr
});
}
return date; return date;
} }
// node_modules/smol-toml/dist/util.js // node_modules/smol-toml/dist/extract.js
function indexOfNewline(str, start = 0, end = str.length) { function extractValue(ctx, end, integersAsBigInt) {
let idx = str.indexOf("\n", start); let ptr = ctx.p;
if (str[idx - 1] === "\r") let c = ctx.s.charCodeAt(ptr);
idx--; if (c === 91 || c === 123) {
return idx <= end ? idx : -1; if (!ctx.d--) {
} throw new TomlError("document contains excessively nested structures. aborting.", {
function skipComment(str, ptr) { toml: ctx.s,
for (let i = ptr; i < str.length; i++) {
let c = str[i];
if (c === "\n")
return i;
if (c === "\r" && str[i + 1] === "\n")
return i + 1;
if (c < " " && c !== " " || c === "\x7F") {
throw new TomlError("control characters are not allowed in comments", {
toml: str,
ptr ptr
}); });
} }
let value = c === 91 ? parseArray(ctx, integersAsBigInt) : parseInlineTable(ctx, integersAsBigInt);
ctx.d++;
return value;
} }
return str.length; if (c === 34 || c === 39) {
} return parseString(ctx);
function skipVoid(str, ptr, banNewLines, banComments) {
let c;
while (1) {
while ((c = str[ptr]) === " " || c === " " || !banNewLines && (c === "\n" || c === "\r" && str[ptr + 1] === "\n"))
ptr++;
if (banComments || c !== "#")
break;
ptr = skipComment(str, ptr);
} }
return ptr; if (c === 116) {
} if (ctx.s.charCodeAt(++ctx.p) !== 114 || ctx.s.charCodeAt(++ctx.p) !== 117 || ctx.s.charCodeAt(++ctx.p) !== 101)
function skipUntil(str, ptr, sep8, end, banNewLines = false) { throw new TomlError("invalid value", { toml: ctx.s, ptr });
if (!end) { ctx.p++;
ptr = indexOfNewline(str, ptr); return true;
return ptr < 0 ? str.length : ptr;
} }
for (let i = ptr; i < str.length; i++) { if (c === 102) {
let c = str[i]; if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 108 || ctx.s.charCodeAt(++ctx.p) !== 115 || ctx.s.charCodeAt(++ctx.p) !== 101)
if (c === "#") { throw new TomlError("invalid value", { toml: ctx.s, ptr });
i = indexOfNewline(str, i); ctx.p++;
if (i < 0) return false;
break;
} else if (c === sep8) {
return i + 1;
} else if (c === end || banNewLines && (c === "\n" || c === "\r" && str[i + 1] === "\n")) {
return i;
}
} }
throw new TomlError("cannot find end of structure", { return parseValue2(ctx, integersAsBigInt, end);
toml: str,
ptr
});
}
// node_modules/smol-toml/dist/extract.js
function sliceAndTrimEndOf(str, startPtr, endPtr) {
let value = str.slice(startPtr, endPtr);
let commentIdx = value.indexOf("#");
if (commentIdx > -1) {
skipComment(str, commentIdx);
value = value.slice(0, commentIdx);
}
return [value.trimEnd(), commentIdx];
}
function extractValue(str, ptr, end, depth, integersAsBigInt) {
if (depth === 0) {
throw new TomlError("document contains excessively nested structures. aborting.", {
toml: str,
ptr
});
}
let c = str[ptr];
if (c === "[" || c === "{") {
let [value, endPtr2] = c === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt);
if (end) {
endPtr2 = skipVoid(str, endPtr2);
if (str[endPtr2] === ",")
endPtr2++;
else if (str[endPtr2] !== end) {
throw new TomlError("expected comma or end of structure", {
toml: str,
ptr: endPtr2
});
}
}
return [value, endPtr2];
}
if (c === '"' || c === "'") {
let [parsed, endPtr2] = parseString(str, ptr);
if (end) {
endPtr2 = skipVoid(str, endPtr2);
if (str[endPtr2] && str[endPtr2] !== "," && str[endPtr2] !== end && str[endPtr2] !== "\n" && str[endPtr2] !== "\r") {
throw new TomlError("unexpected character encountered", {
toml: str,
ptr: endPtr2
});
}
if (str[endPtr2] === ",")
endPtr2++;
}
return [parsed, endPtr2];
}
let endPtr = skipUntil(str, ptr, ",", end);
let slice = sliceAndTrimEndOf(str, ptr, endPtr - (str[endPtr - 1] === "," ? 1 : 0));
if (!slice[0]) {
throw new TomlError("incomplete key-value declaration: no value specified", {
toml: str,
ptr
});
}
if (end && slice[1] > -1) {
endPtr = skipVoid(str, ptr + slice[1]);
if (str[endPtr] === ",")
endPtr++;
}
return [
parseValue2(slice[0], str, ptr, integersAsBigInt),
endPtr
];
} }
// node_modules/smol-toml/dist/struct.js // node_modules/smol-toml/dist/struct.js
var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/; var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
function parseKey(str, ptr, end = "=") { function parseKey(ctx, end = "=") {
let dot = ptr - 1; let start = ctx.p;
let dot = start - 1;
let parsed = []; let parsed = [];
let endPtr = str.indexOf(end, ptr); let endPtr = ctx.s.indexOf(end, start);
if (endPtr < 0) { if (endPtr < 0) {
throw new TomlError("incomplete key-value: cannot find end of key", { throw new TomlError("incomplete key-value: cannot find end of key", {
toml: str, toml: ctx.s,
ptr ptr: start
}); });
} }
do { do {
let c = str[ptr = ++dot]; let c = ctx.s.charCodeAt(ctx.p = ++dot);
if (c !== " " && c !== " ") { if (c !== 32 && c !== 9) {
if (c === '"' || c === "'") { if (c === 34 || c === 39) {
if (c === str[ptr + 1] && c === str[ptr + 2]) { if (c === ctx.s.charCodeAt(ctx.p + 1) && c === ctx.s.charCodeAt(ctx.p + 2)) {
throw new TomlError("multiline strings are not allowed in keys", { throw new TomlError("multiline strings are not allowed in keys", {
toml: str, toml: ctx.s,
ptr ptr: ctx.p
}); });
} }
let [part, eos] = parseString(str, ptr); let part = parseString(ctx);
dot = str.indexOf(".", eos); dot = ctx.s.indexOf(".", ctx.p);
let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot); let strEnd = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
let newLine = indexOfNewline(strEnd); let newLine = indexOfNewline(strEnd);
if (newLine > -1) { if (newLine > -1) {
throw new TomlError("newlines are not allowed in keys", { throw new TomlError("newlines are not allowed in keys", {
toml: str, toml: ctx.s,
ptr: ptr + dot + newLine ptr: newLine
}); });
} }
if (strEnd.trimStart()) { if (strEnd.trimStart()) {
throw new TomlError("found extra tokens after the string part", { throw new TomlError("found extra tokens after the string part", {
toml: str, toml: ctx.s,
ptr: eos ptr: ctx.p
}); });
} }
if (endPtr < eos) { if (endPtr < ctx.p) {
endPtr = str.indexOf(end, eos); endPtr = ctx.s.indexOf(end, ctx.p);
if (endPtr < 0) { if (endPtr < 0) {
throw new TomlError("incomplete key-value: cannot find end of key", { throw new TomlError("incomplete key-value: cannot find end of key", {
toml: str, toml: ctx.s,
ptr ptr: start
}); });
} }
} }
parsed.push(part); parsed.push(part);
} else { } else {
dot = str.indexOf(".", ptr); dot = ctx.s.indexOf(".", ctx.p);
let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot); let part = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
if (!KEY_PART_RE.test(part)) { if (!KEY_PART_RE.test(part)) {
throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", { throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", {
toml: str, toml: ctx.s,
ptr ptr: ctx.p
}); });
} }
parsed.push(part.trimEnd()); parsed.push(part.trimEnd());
} }
} }
} while (dot + 1 && dot < endPtr); } while (dot + 1 && dot < endPtr);
return [parsed, skipVoid(str, endPtr + 1, true, true)]; ctx.p = endPtr + 1;
skipVoid(ctx, true, true);
return parsed;
} }
function parseInlineTable(str, ptr, depth, integersAsBigInt) { function parseInlineTable(ctx, integersAsBigInt) {
let res = {}; let res = {};
let seen = /* @__PURE__ */ new Set(); let seen = /* @__PURE__ */ new Set();
let c; let c;
ptr++; ctx.p++;
while ((c = str[ptr++]) !== "}" && c) { while (ctx.p < ctx.s.length) {
if (c === ",") { skipVoid(ctx);
throw new TomlError("expected value, found comma", { if ((c = ctx.s.charCodeAt(ctx.p)) === 125) {
toml: str, ctx.p++;
ptr: ptr - 1 return res;
}); }
} else if (c === "#") let k;
ptr = skipComment(str, ptr); let t = res;
else if (c !== " " && c !== " " && c !== "\n" && c !== "\r") { let hasOwn = false;
let k; let p = ctx.p;
let t = res; let key = parseKey(ctx);
let hasOwn = false; for (let i = 0; i < key.length; i++) {
let [key, keyEndPtr] = parseKey(str, ptr - 1); if (i)
for (let i = 0; i < key.length; i++) { t = hasOwn ? t[k] : t[k] = {};
if (i) k = key[i];
t = hasOwn ? t[k] : t[k] = {}; if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) {
k = key[i];
if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) {
throw new TomlError("trying to redefine an already defined value", {
toml: str,
ptr
});
}
if (!hasOwn && k === "__proto__") {
Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
}
}
if (hasOwn) {
throw new TomlError("trying to redefine an already defined value", { throw new TomlError("trying to redefine an already defined value", {
toml: str, toml: ctx.s,
ptr ptr: p
}); });
} }
let [value, valueEndPtr] = extractValue(str, keyEndPtr, "}", depth - 1, integersAsBigInt); if (!hasOwn && k === "__proto__") {
seen.add(value); Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
t[k] = value; }
ptr = valueEndPtr; }
if (hasOwn) {
throw new TomlError("trying to redefine an already defined value", {
toml: ctx.s,
ptr: ctx.p
});
}
let value = extractValue(ctx, 125, integersAsBigInt);
seen.add(t[k] = value);
skipVoid(ctx);
if ((c = ctx.s.charCodeAt(ctx.p++)) === 125) {
return res;
}
if (c !== 44) {
throw new TomlError("expected comma or end of structure", { toml: ctx.s, ptr: ctx.p - 1 });
} }
} }
if (!c) { throw new TomlError("unfinished table encountered", {
throw new TomlError("unfinished table encountered", { toml: ctx.s,
toml: str, ptr: ctx.p
ptr });
});
}
return [res, ptr];
} }
function parseArray(str, ptr, depth, integersAsBigInt) { function parseArray(ctx, integersAsBigInt) {
let res = []; let res = [];
let c; let c;
ptr++; ctx.p++;
while ((c = str[ptr++]) !== "]" && c) { while (ctx.p < ctx.s.length) {
if (c === ",") { skipVoid(ctx);
throw new TomlError("expected value, found comma", { if ((c = ctx.s.charCodeAt(ctx.p)) === 93) {
toml: str, ctx.p++;
ptr: ptr - 1 return res;
}); }
} else if (c === "#") res.push(extractValue(ctx, 93, integersAsBigInt));
ptr = skipComment(str, ptr); skipVoid(ctx);
else if (c !== " " && c !== " " && c !== "\n" && c !== "\r") { if ((c = ctx.s.charCodeAt(ctx.p++)) === 93) {
let e = extractValue(str, ptr - 1, "]", depth - 1, integersAsBigInt); return res;
res.push(e[0]); }
ptr = e[1]; if (c !== 44) {
throw new TomlError("expected comma or end of structure", { toml: ctx.s, ptr: ctx.p - 1 });
} }
} }
if (!c) { throw new TomlError("unfinished array encountered", {
throw new TomlError("unfinished array encountered", { toml: ctx.s,
toml: str, ptr: ctx.p
ptr });
});
}
return [res, ptr];
} }
// node_modules/smol-toml/dist/parse.js // node_modules/smol-toml/dist/parse.js
@@ -64394,25 +64346,29 @@ function peekTable(key, table, meta, type) {
return [k, t, state3.c]; return [k, t, state3.c];
} }
function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) { function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
let ctx = { s: toml, p: 0, d: maxDepth };
let res = {}; let res = {};
let meta = {}; let meta = {};
let tmp;
let tbl = res; let tbl = res;
let m = meta; let m = meta;
for (let ptr = skipVoid(toml, 0); ptr < toml.length; ) { skipVoid(ctx);
if (toml[ptr] === "[") { while (ctx.p < toml.length) {
let isTableArray = toml[++ptr] === "["; if (toml.charCodeAt(ctx.p) === 91) {
let k = parseKey(toml, ptr += +isTableArray, "]"); let isTableArray = toml.charCodeAt(++ctx.p) === 91;
tmp = ctx.p += +isTableArray;
let k = parseKey(ctx, "]");
if (isTableArray) { if (isTableArray) {
if (toml[k[1] - 1] !== "]") { if (toml.charCodeAt(ctx.p - 1) !== 93) {
throw new TomlError("expected end of table declaration", { throw new TomlError("expected end of table declaration", {
toml, toml,
ptr: k[1] - 1 ptr: ctx.p - 1
}); });
} }
k[1]++; ctx.p++;
} }
let p = peekTable( let p = peekTable(
k[0], k,
res, res,
meta, meta,
isTableArray ? 2 : 1 isTableArray ? 2 : 1
@@ -64421,16 +64377,16 @@ function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
if (!p) { if (!p) {
throw new TomlError("trying to redefine an already defined table or value", { throw new TomlError("trying to redefine an already defined table or value", {
toml, toml,
ptr ptr: tmp
}); });
} }
m = p[2]; m = p[2];
tbl = p[1]; tbl = p[1];
ptr = k[1];
} else { } else {
let k = parseKey(toml, ptr); tmp = ctx.p;
let k = parseKey(ctx);
let p = peekTable( let p = peekTable(
k[0], k,
tbl, tbl,
m, m,
0 0
@@ -64439,21 +64395,19 @@ function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
if (!p) { if (!p) {
throw new TomlError("trying to redefine an already defined table or value", { throw new TomlError("trying to redefine an already defined table or value", {
toml, toml,
ptr ptr: tmp
}); });
} }
let v = extractValue(toml, k[1], void 0, maxDepth, integersAsBigInt); p[1][p[0]] = extractValue(ctx, void 0, integersAsBigInt);
p[1][p[0]] = v[0];
ptr = v[1];
} }
ptr = skipVoid(toml, ptr, true); skipVoid(ctx, true);
if (toml[ptr] && toml[ptr] !== "\n" && toml[ptr] !== "\r") { if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && tmp !== 13) {
throw new TomlError("each key-value declaration must be followed by an end-of-line", { throw new TomlError("each key-value declaration must be followed by an end-of-line", {
toml, toml,
ptr ptr: ctx.p
}); });
} }
ptr = skipVoid(toml, ptr); skipVoid(ctx);
} }
return res; return res;
} }
@@ -64484,13 +64438,14 @@ function loadInputs() {
const version3 = getInput("version"); const version3 = getInput("version");
const versionFile = getVersionFile(workingDirectory); const versionFile = getVersionFile(workingDirectory);
const pythonVersion = getPythonVersion(versionFile); const pythonVersion = getPythonVersion(versionFile);
const pythonArch = getInput("python-arch");
const activateEnvironment = getBooleanInput("activate-environment"); const activateEnvironment = getBooleanInput("activate-environment");
const noProject = getBooleanInput("no-project"); const noProject = getBooleanInput("no-project");
const venvPath = getVenvPath(workingDirectory, activateEnvironment); const venvPath = getVenvPath(workingDirectory, activateEnvironment);
const checksum = getInput("checksum"); const checksum = getInput("checksum");
const enableCache = getEnableCache(); const enableCache = getEnableCache();
const restoreCache2 = getInput("restore-cache") === "true"; const restoreCache2 = getInput("restore-cache") === "true";
const saveCache4 = getInput("save-cache") === "true"; const saveCache4 = getSaveCache();
const cacheSuffix = getInput("cache-suffix") || ""; const cacheSuffix = getInput("cache-suffix") || "";
const cacheLocalPath = getCacheLocalPath( const cacheLocalPath = getCacheLocalPath(
workingDirectory, workingDirectory,
@@ -64527,6 +64482,7 @@ function loadInputs() {
manifestFile, manifestFile,
noProject, noProject,
pruneCache: pruneCache2, pruneCache: pruneCache2,
pythonArch,
pythonDir, pythonDir,
pythonVersion, pythonVersion,
quiet: quiet2, quiet: quiet2,
@@ -64600,6 +64556,17 @@ function getEnableCache() {
} }
return enableCacheInput === "true"; return enableCacheInput === "true";
} }
function getSaveCache() {
const saveCacheInput = getInput("save-cache");
if (saveCacheInput === "auto") {
if (process.env.GITHUB_EVENT_NAME === "merge_group") {
info2("Cache saving is disabled for the merge_group event");
return false;
}
return true;
}
return saveCacheInput === "true";
}
function getToolBinDir(workingDirectory) { function getToolBinDir(workingDirectory) {
const toolBinDirInput = getInput("tool-bin-dir"); const toolBinDirInput = getInput("tool-bin-dir");
if (toolBinDirInput !== "") { if (toolBinDirInput !== "") {
@@ -64764,6 +64731,15 @@ function getResolutionStrategy() {
); );
} }
// src/cache/restore-cache.ts
var STATE_CACHE_KEY = "cache-key";
var STATE_CACHE_MATCHED_KEY = "cache-matched-key";
var STATE_PYTHON_CACHE_MATCHED_KEY = "python-cache-matched-key";
// src/utils/constants.ts
var STATE_UV_PATH = "uv-path";
var STATE_UV_VERSION = "uv-version";
// src/save-cache.ts // src/save-cache.ts
function formatUnexpectedFailure(error2) { function formatUnexpectedFailure(error2) {
if (error2 instanceof Error) { if (error2 instanceof Error) {
@@ -64899,8 +64875,8 @@ undici/lib/web/websocket/frame.js:
smol-toml/dist/date.js: smol-toml/dist/date.js:
smol-toml/dist/error.js: smol-toml/dist/error.js:
smol-toml/dist/primitive.js:
smol-toml/dist/util.js: smol-toml/dist/util.js:
smol-toml/dist/primitive.js:
smol-toml/dist/extract.js: smol-toml/dist/extract.js:
smol-toml/dist/struct.js: smol-toml/dist/struct.js:
smol-toml/dist/parse.js: smol-toml/dist/parse.js:

2423
dist/setup/index.cjs generated vendored

File diff suppressed because it is too large Load Diff

144
dist/update-known-checksums/index.cjs generated vendored
View File

@@ -47182,6 +47182,150 @@ var semver = __toESM(require_semver(), 1);
// src/download/checksum/known-checksums.json // src/download/checksum/known-checksums.json
var known_checksums_default = { var known_checksums_default = {
"aarch64-apple-darwin-0.12.20": "848fdeb602ff1a1baacd4f6c8b7bdc6cf1ad026a6d9cf59475fda17c179743ca",
"aarch64-pc-windows-msvc-0.12.20": "b6bd9218855591742ffd3b00fcf2044b4d2fb6446b6a3545e0dfee447e950388",
"aarch64-unknown-linux-gnu-0.12.20": "8a7aad7bc76a2fae5151566ff3e43eacce0b2a113d5e4de3e4afe3e58fa2441e",
"aarch64-unknown-linux-musl-0.12.20": "94bb13feeebc6b59a4124016c957cdc9ee406d1476ce2b2ce2991e95b8e820b7",
"arm-unknown-linux-musleabihf-0.12.20": "6aeef64cf07b43135d6b1c20bd57809f2d965d0f8a2d5602230d5d55b8245477",
"armv7-unknown-linux-gnueabihf-0.12.20": "e1c53318608448ad3b8e7f2e9b069936730a6e7b47831ba5446e4b4f436ee715",
"armv7-unknown-linux-musleabihf-0.12.20": "a4c3a0e12e5489f092c93b232ddc4a811a6ea9a03f447f91f88e96867c0bac8d",
"i686-pc-windows-msvc-0.12.20": "1a372c273370ae9a7e9aa84020ce91fc1d9ebecbd287c3447e7e99cada0b14f3",
"i686-unknown-linux-gnu-0.12.20": "f1e83cc88970ed799b507a8392152d19916dfa0b6c9ae9c8145742035a40d5cb",
"i686-unknown-linux-musl-0.12.20": "11d541dd32dd779adbdfef69fe30d7d325036f50d394d3f260a0042998e05499",
"powerpc64le-unknown-linux-gnu-0.12.20": "39224a5bfc21a8041afc0315e5d47c86acecf4e669944564950996b516fb5987",
"riscv64gc-unknown-linux-gnu-0.12.20": "5cb9df36ca64fb72673c59a77b955b50f3bb907689a98d1d8d640aa3e71f2660",
"riscv64gc-unknown-linux-musl-0.12.20": "360e91a317a27bd33978577c57b6f3ed778bdfe8c30c9b613e46fdc33bf8aee8",
"s390x-unknown-linux-gnu-0.12.20": "25485439b52cb029afa724c442418ca08a53122100f8cce68ccceb88323ccde2",
"x86_64-apple-darwin-0.12.20": "ac54283d211fd77cdc152b67606dbaf6406ff4ab03f3af4ae99468fa8e887141",
"x86_64-pc-windows-msvc-0.12.20": "95f9bc30fbb3574d276e28ac4a6de932d25153645853d13da8c21eec3bc88d06",
"x86_64-unknown-linux-gnu-0.12.20": "6590717592ace991ff83a63fef799e3ad9d33ecc8f96c5d6bdd732496e79337f",
"x86_64-unknown-linux-musl-0.12.20": "14114d66a094f1907af0fcbc863f34226bbb7f5e430e13dce6676ba40dcc6891",
"aarch64-apple-darwin-0.12.19": "a9a8df1eedeb192f2e47e40e2faabfb387db4b850209118786d42f89dde3e0ba",
"aarch64-pc-windows-msvc-0.12.19": "115b54cb823bc48260670f5782001add6067ac8d98d18c8263a833704e287de9",
"aarch64-unknown-linux-gnu-0.12.19": "0804e9b164c64b6914182d5920c08551958a095986f10a3731056df701126436",
"aarch64-unknown-linux-musl-0.12.19": "ad8d8448a2ff642ba62c2f684d7dd22a03f8eb3fc9918c2c3e8ec975f4ed6710",
"arm-unknown-linux-musleabihf-0.12.19": "173b6b118e444dc3b3a0b6337dd87d66fa79835aa5e059d79e942ae33a850e20",
"armv7-unknown-linux-gnueabihf-0.12.19": "f47fe74244c4adcff20637c1aee2550dbc31c81ccf0b2a9537bf98b24bc4028a",
"armv7-unknown-linux-musleabihf-0.12.19": "0df353aac087509c47fe660837ca5d284858ef4a5eec4042cbcdeb0118ba0f1b",
"i686-pc-windows-msvc-0.12.19": "e1c2d19d1173a0e9f81ba3f95881ad741808133e372610889ff6870629218c7f",
"i686-unknown-linux-gnu-0.12.19": "952b0bae707e19b2b5d012b46519a2159be929273d466a1437759f0961be0b93",
"i686-unknown-linux-musl-0.12.19": "f923ac32e0e5139950fe1b63abab74d48cabb94b15c90637bc380dadcaf4da40",
"powerpc64le-unknown-linux-gnu-0.12.19": "e30649ad846a14bd96440efd45fdb60dcdf8db088fb143064aa78632048ad957",
"riscv64gc-unknown-linux-gnu-0.12.19": "50a83ea999ea861a6a853ae1ad0982baad96cc6451e46a5d7e366c4d9475f1bb",
"riscv64gc-unknown-linux-musl-0.12.19": "051de9eda7e09dab4c8a304ab2e119317649fee0e24efd0358f410d0c5b3407f",
"s390x-unknown-linux-gnu-0.12.19": "e6a9149ea122c1b3b9719ca3577c321376e3c400e004c3cc18231fdb1d35107b",
"x86_64-apple-darwin-0.12.19": "cb5fa57bafe68fc0fb94b17f06bee0b0b9a7feb94ccbd110445afa0696e39273",
"x86_64-pc-windows-msvc-0.12.19": "6dbb02d79e419522f1c500f0adb1cddcff0cda7d59b0d66ea7f5e3b4a1b2f5f0",
"x86_64-unknown-linux-gnu-0.12.19": "23bf5552d220e0842b65c862097b2ebaeba0064b74eda5e565e77fd25969d8c8",
"x86_64-unknown-linux-musl-0.12.19": "db7278c9f57981338fddff1fb250e11964bc0a4fafcb9eed8303fdb117dc067b",
"aarch64-apple-darwin-0.12.18": "cf40e0c6a202190ccd9e0406dcfdd5b2d6668a9a5c779b17948963df32aafe5b",
"aarch64-pc-windows-msvc-0.12.18": "17f27b1c64eacc757ae603579f116a014881e486c5e79ae81877980d4699e943",
"aarch64-unknown-linux-gnu-0.12.18": "afb6291f3f0a6b4521fc67b947822506c41dde5b60d2189dd8f3695b2ac8c9e7",
"aarch64-unknown-linux-musl-0.12.18": "0796973fb3eea8095078c3d0659bd17a5f6789a71b8dd85caff2483178f78ac3",
"arm-unknown-linux-musleabihf-0.12.18": "a37127fb331d5e6228efc1f8549d2447b50c907eee4629347f150a649083619c",
"armv7-unknown-linux-gnueabihf-0.12.18": "a38e82350e1e95d5526d1ab81d9b4eb676815c51646243b3b3fbc55b218732d1",
"armv7-unknown-linux-musleabihf-0.12.18": "41f0808328f65910bacdb487638475715f949900c7a23b393b3754e2156ff15a",
"i686-pc-windows-msvc-0.12.18": "e04c0f1fd9a8703761f9edd64d797ddb2c9a3e6eec0e2fed234a7bd2c2e868b9",
"i686-unknown-linux-gnu-0.12.18": "278dbc5dfc6bdde33a553fdba53174cc49daf512a857db1b3c1b5d663290196f",
"i686-unknown-linux-musl-0.12.18": "ebfdaaafc447fb2a7329cde879a7748b2ab40ecdcd3d5f04fc0a5d1ab79bb0bd",
"powerpc64le-unknown-linux-gnu-0.12.18": "332d174248230ed599a9df0e4e77d6921dbb42ca0fdfbe26eb2a6c999da936b3",
"riscv64gc-unknown-linux-gnu-0.12.18": "be88652a03225acbd6bf7204d006b244b0743c8c756a35137c209fa4ff731c41",
"riscv64gc-unknown-linux-musl-0.12.18": "29d34dcc833b99b09f78fa11c66fa3c490c3e37c4f0d754e7b84f7147850190e",
"s390x-unknown-linux-gnu-0.12.18": "ac412f7ab2a096a7302e0ae8828c7ef84db8a1f7ff97acba8ff8987d46d39cec",
"x86_64-apple-darwin-0.12.18": "2e4108f5395397c8bc5d43bf83d3bdbb2d0e92b90d0efa607756be704905fa33",
"x86_64-pc-windows-msvc-0.12.18": "cae6a3bc25239f83dffb467a4b180508d9da23986c04639ebfa44e43e6a84bff",
"x86_64-unknown-linux-gnu-0.12.18": "89eadd7c76fc063887959510d5ba0ab1264dfd5f1143b925ddb73021a40acf16",
"x86_64-unknown-linux-musl-0.12.18": "e38d97460b98ebfd31b197de0fe9fa578add4bc8ba0179b203dd3f87b99f98e6",
"aarch64-apple-darwin-0.12.17": "85f00cbdc6dd3e97eba4c31b4d014375a9fdfe8f570023b84e5102fc3456896b",
"aarch64-pc-windows-msvc-0.12.17": "3e1aa6849d77f0e00dc865e4afab5c5b32de053e21fe35bf5ad5cec3734ec976",
"aarch64-unknown-linux-gnu-0.12.17": "d636d1b678e9e7f367ecb22b46bd1cabbed234d6bc3b4d96365d2b507f72f86c",
"aarch64-unknown-linux-musl-0.12.17": "a6096da273d548cb9f277d237a01ac7344a39ef0f455c0e148e4dc9737c1596b",
"arm-unknown-linux-musleabihf-0.12.17": "16a98a65ef8545f7c32cf717683aac44248369ffaa41c43e665341489359c654",
"armv7-unknown-linux-gnueabihf-0.12.17": "796e101976e18a0f92d90b6f3efd289f77fbc5afd1aaa6fdedd3c84c209eabab",
"armv7-unknown-linux-musleabihf-0.12.17": "421c5f9c53d49088e705e7a64fea147082a2191178ea1d8c51d9ad758ca899f6",
"i686-pc-windows-msvc-0.12.17": "1d3653cb6eafd1e675e979d7cd8eeac1456202f8927a2216419993077a4c473f",
"i686-unknown-linux-gnu-0.12.17": "3faa79a70e2a1aa6eb3cd78eba02263f3e4b17b6be584a01429968f92ff74966",
"i686-unknown-linux-musl-0.12.17": "fc05220cfa1c6585e0e209877c228393b25a96e17cd43028b06566ac894cd078",
"powerpc64le-unknown-linux-gnu-0.12.17": "eb6dbedaaa622af32cba2388e0d2d47e34c8724d4214a129d614b96f071d8e53",
"riscv64gc-unknown-linux-gnu-0.12.17": "65b807b24357133c49d97ca9394ee7e13ca62822e1095376c809654b35f39cf2",
"riscv64gc-unknown-linux-musl-0.12.17": "87c339a735b578f285b961bebdefe0a671f3652477d1e84dc69cd1a829f45e92",
"s390x-unknown-linux-gnu-0.12.17": "d99f69f47fc5e0975d6e7a5745cf2332317015caffb3bb81e5154cc7b66fa77a",
"x86_64-apple-darwin-0.12.17": "8dcf05a8c809bb3c471d2b614788ba27a6e41298fc8c31ac84b5f4339fd468e5",
"x86_64-pc-windows-msvc-0.12.17": "a252121d5b59398fcb137c6ea448176459a44010f33f67e0072305a637119ca7",
"x86_64-unknown-linux-gnu-0.12.17": "fa82fd8dde8e8eefdecada6aa0889666556cfceb690d06e0c3bca49eb3070a63",
"x86_64-unknown-linux-musl-0.12.17": "6401c4665d8fa2a9893e087c91f585430738e3170f5398a1141483efb4a93310",
"aarch64-apple-darwin-0.12.16": "b6e03fae61704b1aa622f12b792a69483e837b83068e44f4fd34f8a07a8f74a3",
"aarch64-pc-windows-msvc-0.12.16": "9977129f89c4036edfcb200d2484755571e51fa74517f02e478c1d7bcc353b2e",
"aarch64-unknown-linux-gnu-0.12.16": "36d913ee9c647481d64f1a0a0485f85ff2feaee605c341fc22e73398f9212c26",
"aarch64-unknown-linux-musl-0.12.16": "5beba1f35c0922fd086cce850ce919e55bc4e873c4fcda891343526afdb4c5b3",
"arm-unknown-linux-musleabihf-0.12.16": "d91fa9dede60e851e4bb3ae8060300042bc6bf924476fae71898d2c08c46a9cf",
"armv7-unknown-linux-gnueabihf-0.12.16": "fbdfca5d4ace4a5abbf343c0f10a0b68c5eac0201073d2a504e32c57c0873669",
"armv7-unknown-linux-musleabihf-0.12.16": "f5a3b6c7fbd4c7ea66cbd704d821ffed0d20abbfa8a12c2e68d6dd22476d308b",
"i686-pc-windows-msvc-0.12.16": "0d4889cc6c4058f4fbc28f6c50ec09b528ef998547cac5c3425e1a0b8169e847",
"i686-unknown-linux-gnu-0.12.16": "0e8743e653ed124c526a9e86ee6a08fa6eee7618a3f12cc9033c74674bd2047f",
"i686-unknown-linux-musl-0.12.16": "f609686cbe67884eeb57daebd58eb0fef35f930dd92fd2c14e931da7515c7454",
"powerpc64le-unknown-linux-gnu-0.12.16": "312dc82f441debff371fe5fc0068b538787678d6d79edc86f028b011920a2f6a",
"riscv64gc-unknown-linux-gnu-0.12.16": "8b0142eee9d291c602218126e3fc558fe9bc1b7c8f1cc0b03dcd8df9f2f218a1",
"riscv64gc-unknown-linux-musl-0.12.16": "188af30f025c35569b302b84793a4c286f6740902885d054917375edbfd0193c",
"s390x-unknown-linux-gnu-0.12.16": "b90cc954c2cd52b695104e215189a0c8d9e6ceaee753c9be1a871bb8d969e9c3",
"x86_64-apple-darwin-0.12.16": "a42bcc9ce97eb8b364d7f162233a9c6b8c0ee25388e551d362809795127e0c31",
"x86_64-pc-windows-msvc-0.12.16": "f730454bf09019754e5e5abd71a8aa18683cb739cba0d9c720bac2e7c901160f",
"x86_64-unknown-linux-gnu-0.12.16": "8e5c6e5523dffc2dcf615bd995554c84c9feb4e577808a3fb8698a639d3f8d9c",
"x86_64-unknown-linux-musl-0.12.16": "a01206ffbd60f3a7ee30949be1863527986f5307494a064042c69ce7e6d44799",
"aarch64-apple-darwin-0.12.15": "dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d",
"aarch64-pc-windows-msvc-0.12.15": "a37c8e96cb1260488c8510b64c848533a3a82a2fdf9e905de7c2700ceebf6437",
"aarch64-unknown-linux-gnu-0.12.15": "0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08",
"aarch64-unknown-linux-musl-0.12.15": "93b801abb146e6431fb0434346a0162e65d3f0d1cd7360144d04c43488fd7f7d",
"arm-unknown-linux-musleabihf-0.12.15": "9b0204dbd368a7a5f84d3ef015684c3b0e830911641ebf4575f44ad4901c1b3e",
"armv7-unknown-linux-gnueabihf-0.12.15": "a0afe9cfc7dc4acc18e613f68c5b010b849323b3a3d6e9311b29d289dc94f95e",
"armv7-unknown-linux-musleabihf-0.12.15": "a113c782e6f96a56f73aba601cde73ddbe877e0a4179eabeb5b6e86be9bb75d9",
"i686-pc-windows-msvc-0.12.15": "cc8b28f77cf19f7ed88569d6d9163e503ebc94e1b70069889852bcf38839c559",
"i686-unknown-linux-gnu-0.12.15": "6fa19118f01ee547d5b9a3f4af389c5c929a34e0074a4313d3cdb3ce9c97fdcd",
"i686-unknown-linux-musl-0.12.15": "b66d6cf7916addeda13fbb61abe003ecc62f048e3a213d6bd2494ca7e8022989",
"powerpc64le-unknown-linux-gnu-0.12.15": "5f49c97ae7ec25c45513466e00a32cacb148f3824367c7e498c0b53a270bc1e2",
"riscv64gc-unknown-linux-gnu-0.12.15": "4c8f75c5969737b67621957010df5337bb721a8d48fdbb1620f5d35c3f1dd268",
"riscv64gc-unknown-linux-musl-0.12.15": "8c03514f57e517eb87a376deb3d6475045f6ce550956c6082910b4a529d08a47",
"s390x-unknown-linux-gnu-0.12.15": "1f5701cb5eedc5a34d3dd5896ca3bf509b15d382b3448f370df46e0a631889c1",
"x86_64-apple-darwin-0.12.15": "e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b",
"x86_64-pc-windows-msvc-0.12.15": "477bd99a84e34891f2bd4c9152ddeb74e971accccbc59c0f0301f11f08a32d46",
"x86_64-unknown-linux-gnu-0.12.15": "f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638",
"x86_64-unknown-linux-musl-0.12.15": "999c0c3da986953e508985c3932d283d2c62eb167b4f8d81e79f565e34104959",
"aarch64-apple-darwin-0.12.14": "dfed5683c5873d65eff8476eb93526059b81e5646a68305b5c94a26b29990894",
"aarch64-pc-windows-msvc-0.12.14": "46b930bdbb338099c7d9da711b751240eb97876eda6a553a2c28323967232041",
"aarch64-unknown-linux-gnu-0.12.14": "7fb91bd5d10529c60723eaec3caf44726f89280e5aeed78af8fc63fcad004c9b",
"aarch64-unknown-linux-musl-0.12.14": "571b5c73c9bcc294f8087f22613edb7c7ceb191f4dbf8cafd3f2ff15e6147d36",
"arm-unknown-linux-musleabihf-0.12.14": "6e0df0e690d5c29ce65ec6962d8b262a93e9951077f05d78943f858e7d6e9185",
"armv7-unknown-linux-gnueabihf-0.12.14": "c20a18bb275a6fc2599bc321d37e52650a449237c6111da203a1d73b45921b25",
"armv7-unknown-linux-musleabihf-0.12.14": "a128725e1e40226a9309d603cbb4c36e272932092a77f4d0478ef2fb8eacaa05",
"i686-pc-windows-msvc-0.12.14": "ddd9afd789c60a38d82f3021239e22daacc67b9ef0719345ee6f0dcc37ab93ae",
"i686-unknown-linux-gnu-0.12.14": "de65ccdb90dd818248161db761ae3b6713b1b3230a1b55068ad327598b3a14b8",
"i686-unknown-linux-musl-0.12.14": "268538a3b90c90f7d68d31ed781f0f2cb8618188019c8bb09ce0e7876bb54829",
"powerpc64le-unknown-linux-gnu-0.12.14": "6a6c2a91d6240700eb36895c3fb0533bd5e9c696a95e0a55f7a7ae844cbde537",
"riscv64gc-unknown-linux-gnu-0.12.14": "df2c854c77b1d32f75ef08282511b050066b3db9d7abc4dc2c23ea26227c6b74",
"riscv64gc-unknown-linux-musl-0.12.14": "c6d0824ebdf23811dfa659148ae2c224b385d07ae1b4c282e5bf6abe3d603a74",
"s390x-unknown-linux-gnu-0.12.14": "e01aec9706c88f93f90409eab42324571e2b2c9c2938aaa266ad048b37c52c6f",
"x86_64-apple-darwin-0.12.14": "e11a70264ceca38e929ecaeed953c323e517af7b960ebf9722d5918e8c7f0375",
"x86_64-pc-windows-msvc-0.12.14": "02cecb254f37f3396da625680796d3990164a590fb5611d46f719ad83e7b9a89",
"x86_64-unknown-linux-gnu-0.12.14": "18ef5c3888ae59828cb13f38d57e9389b8173ecc719eff163bfafc74b38f5936",
"x86_64-unknown-linux-musl-0.12.14": "df163630683e5a2106d3320e2a448fde8eda5e7b9b47f617c5c332769728e735",
"aarch64-apple-darwin-0.12.13": "7e6ddb9316acc00f2296c82ff4d99977870ee34b2f0ddcae9444d714db9364ed",
"aarch64-pc-windows-msvc-0.12.13": "1efb2654b06e7063d4ac1fc9d49a9bda9a6704d82f035b589a2751a592f14151",
"aarch64-unknown-linux-gnu-0.12.13": "2eaa5d94f5db7b3a1a092156b9420459e42ab0217d917fe74a876309cef9b5e9",
"aarch64-unknown-linux-musl-0.12.13": "f44bc1037a17889fe562fffd2002d4ed108e499fbe68b4f022af244dc7b8244f",
"arm-unknown-linux-musleabihf-0.12.13": "2c7644f891edcf1e74a1b9dde96ea4ba00b41301c936c87e843683656703ada2",
"armv7-unknown-linux-gnueabihf-0.12.13": "19252c4d21fce112817b9e07bef6b2e9c90cef80fe82659533105b37a772d067",
"armv7-unknown-linux-musleabihf-0.12.13": "54e2c10e4e6c18a3efbac645ea02d7e6b768ae2f975275595915a7039e802b75",
"i686-pc-windows-msvc-0.12.13": "4ddcdf859d3bd337a156a2fc567e685e4b3d61e07b4a2dbbed7aeb4325e116ac",
"i686-unknown-linux-gnu-0.12.13": "beb56f6eda61bc69a8acc1bca07929365aa5cd2e912e35c35003a45e266d8a0e",
"i686-unknown-linux-musl-0.12.13": "6c93a9703b6145266240cb2aeb31d3574c21b33570fddf92461707b906eb3a65",
"powerpc64le-unknown-linux-gnu-0.12.13": "cd45ac73fc711e717602a4dc0c9e19d9c6563d15b14515a9a5dd49b00172a8b6",
"riscv64gc-unknown-linux-gnu-0.12.13": "ff1fb4d7e4c1d3a4acc6eff69b2530e846964260469df345e0239059517c0a21",
"riscv64gc-unknown-linux-musl-0.12.13": "b88312b410c1183e33ae9fa7738f35b7cd7396b2aa0e82836d7e88dbf23e5fb5",
"s390x-unknown-linux-gnu-0.12.13": "d41e4784c2187c76970690a9e9a288231f5ec8d2160ad8464be74aa9c06717e8",
"x86_64-apple-darwin-0.12.13": "5e287ef61cb6a9b61b3a83fef124fd143e400468a7dac794230147a810e17119",
"x86_64-pc-windows-msvc-0.12.13": "a86c9dc7bad9b03f388583b7187c05fe9951c2e0d392217e8fd43d97787f6ec2",
"x86_64-unknown-linux-gnu-0.12.13": "745765a3b6e360ad76743599ae5c42e9278c7edf8bbff9fc76d05bf2623a04dd",
"x86_64-unknown-linux-musl-0.12.13": "4e2bfd0c9007b1032a50e539e965fd0a6037d87ad93ae1580d220a92d4c94098",
"aarch64-apple-darwin-0.12.12": "46740540b63fdee9a6cb2e19baf3f1f475b850c440a33e63455087a6871263f1", "aarch64-apple-darwin-0.12.12": "46740540b63fdee9a6cb2e19baf3f1f475b850c440a33e63455087a6871263f1",
"aarch64-pc-windows-msvc-0.12.12": "36559da51ecee83b2b1d80aa1a0ede2f80e2d9e5761fffcbb9e9366a7f3d022a", "aarch64-pc-windows-msvc-0.12.12": "36559da51ecee83b2b1d80aa1a0ede2f80e2d9e5761fffcbb9e9366a7f3d022a",
"aarch64-unknown-linux-gnu-0.12.12": "fe08db50cc1b56cd1da7801065ed1103d27ed3f9571cd122386cfc7faf1b8df5", "aarch64-unknown-linux-gnu-0.12.12": "fe08db50cc1b56cd1da7801065ed1103d27ed3f9571cd122386cfc7faf1b8df5",

View File

@@ -6,7 +6,7 @@ This document covers advanced options for configuring which version of uv to ins
```yaml ```yaml
- name: Install the latest version of uv - name: Install the latest version of uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: "latest" version: "latest"
``` ```
@@ -19,7 +19,7 @@ When `manifest-file` is set, `latest-known` still selects a version from setup-u
```yaml ```yaml
- name: Install the latest version of uv known to setup-uv - name: Install the latest version of uv known to setup-uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: "latest-known" version: "latest-known"
``` ```
@@ -28,7 +28,7 @@ When `manifest-file` is set, `latest-known` still selects a version from setup-u
```yaml ```yaml
- name: Install a specific version of uv - name: Install a specific version of uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: "0.4.4" version: "0.4.4"
``` ```
@@ -41,21 +41,21 @@ to install the latest version that satisfies the range.
```yaml ```yaml
- name: Install a semver range of uv - name: Install a semver range of uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: ">=0.4.0" version: ">=0.4.0"
``` ```
```yaml ```yaml
- name: Pinning a minor version of uv - name: Pinning a minor version of uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: "0.4.x" version: "0.4.x"
``` ```
```yaml ```yaml
- name: Install a pep440-specifier-satisfying version of uv - name: Install a pep440-specifier-satisfying version of uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: ">=0.4.25,<0.5" version: ">=0.4.25,<0.5"
``` ```
@@ -67,7 +67,7 @@ You can change this behavior using the `resolution-strategy` input:
```yaml ```yaml
- name: Install the lowest compatible version of uv - name: Install the lowest compatible version of uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: ">=0.4.0" version: ">=0.4.0"
resolution-strategy: "lowest" resolution-strategy: "lowest"
@@ -92,7 +92,7 @@ as `UV_PYTHON`. Only a single Python version is supported; multiple fallback ver
```yaml ```yaml
- name: Install uv based on the version defined in pyproject.toml - name: Install uv based on the version defined in pyproject.toml
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version-file: "pyproject.toml" version-file: "pyproject.toml"
``` ```
@@ -103,7 +103,7 @@ silently picking up a newer uv until the lockfile is updated.
```yaml ```yaml
- name: Install uv based on the version locked in uv.lock - name: Install uv based on the version locked in uv.lock
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version-file: "uv.lock" version-file: "uv.lock"
``` ```

View File

@@ -11,6 +11,7 @@ The cache key is automatically generated based on:
`pc-windows-msvc`) `pc-windows-msvc`)
- **OS version**: OS name and version (e.g., `ubuntu-22.04`, `macos-14`, `windows-2022`) - **OS version**: OS name and version (e.g., `ubuntu-22.04`, `macos-14`, `windows-2022`)
- **Python version**: The Python version in use - **Python version**: The Python version in use
- **Python architecture**: The architecture selected by `python-arch` or `UV_PYTHON_ARCH`, when set
- **Cache options**: Whether pruning and Python caching are enabled - **Cache options**: Whether pruning and Python caching are enabled
- **Dependency hash**: Hash of files matching `cache-dependency-glob` - **Dependency hash**: Hash of files matching `cache-dependency-glob`
- **Suffix**: Optional `cache-suffix` if provided - **Suffix**: Optional `cache-suffix` if provided
@@ -23,7 +24,7 @@ The computed cache key is available as the `cache-key` output:
```yaml ```yaml
- name: Setup uv - name: Setup uv
id: setup-uv id: setup-uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
- name: Print cache key - name: Print cache key
@@ -53,7 +54,7 @@ You can optionally define a custom cache key suffix.
```yaml ```yaml
- name: Enable caching and define a custom cache key suffix - name: Enable caching and define a custom cache key suffix
id: setup-uv id: setup-uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
cache-suffix: "optional-suffix" cache-suffix: "optional-suffix"
@@ -92,7 +93,7 @@ changes. If you use relative paths, they are relative to the working directory.
```yaml ```yaml
- name: Define a cache dependency glob - name: Define a cache dependency glob
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
cache-dependency-glob: "**/pyproject.toml" cache-dependency-glob: "**/pyproject.toml"
@@ -100,7 +101,7 @@ changes. If you use relative paths, they are relative to the working directory.
```yaml ```yaml
- name: Define a list of cache dependency globs - name: Define a list of cache dependency globs
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
@@ -110,7 +111,7 @@ changes. If you use relative paths, they are relative to the working directory.
```yaml ```yaml
- name: Define an absolute cache dependency glob - name: Define an absolute cache dependency glob
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
cache-dependency-glob: "/tmp/my-folder/requirements*.txt" cache-dependency-glob: "/tmp/my-folder/requirements*.txt"
@@ -118,7 +119,7 @@ changes. If you use relative paths, they are relative to the working directory.
```yaml ```yaml
- name: Never invalidate the cache - name: Never invalidate the cache
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
cache-dependency-glob: "" cache-dependency-glob: ""
@@ -131,7 +132,7 @@ By default, the cache will be restored.
```yaml ```yaml
- name: Don't restore an existing cache - name: Don't restore an existing cache
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
restore-cache: false restore-cache: false
@@ -139,13 +140,15 @@ By default, the cache will be restored.
## Save cache ## Save cache
You can also disable saving the cache after the run with the `save-cache` input. You can control saving the cache after the run with the `save-cache` input.
This can be useful to save cache storage when you know you will not use the cache of the run again. This can be useful to save cache storage when you know you will not use the cache of the run again.
By default, the cache will be saved. By default, `save-cache: auto` saves the cache except for `merge_group` events, where caches created
for temporary merge queue refs are unlikely to be reused. Cache restoration remains enabled for
these events. Set `save-cache: true` to save the cache for all events.
```yaml ```yaml
- name: Don't save the cache after the run - name: Don't save the cache after the run
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
save-cache: false save-cache: false
@@ -171,7 +174,7 @@ It defaults to `setup-uv-cache` in the `TMP` dir, `D:\a\_temp\setup-uv-cache` on
```yaml ```yaml
- name: Define a custom uv cache path - name: Define a custom uv cache path
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
cache-local-path: "/path/to/cache" cache-local-path: "/path/to/cache"
``` ```
@@ -188,7 +191,7 @@ If you want to prune the cache before saving it, enable cache pruning with the `
```yaml ```yaml
- name: Prune the cache before saving it - name: Prune the cache before saving it
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
prune-cache: true prune-cache: true
@@ -207,7 +210,7 @@ To force managed Python installs, set `UV_PYTHON_PREFERENCE=only-managed`.
```yaml ```yaml
- name: Cache Python installs - name: Cache Python installs
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
cache-python: true cache-python: true
@@ -225,7 +228,7 @@ If you want to ignore this, set the `ignore-nothing-to-cache` input to `true`.
```yaml ```yaml
- name: Ignore nothing to cache - name: Ignore nothing to cache
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
ignore-nothing-to-cache: true ignore-nothing-to-cache: true

View File

@@ -11,7 +11,7 @@ You can specify a checksum to override those values. The sha256 hashes can also
```yaml ```yaml
- name: Install a specific version and validate the checksum - name: Install a specific version and validate the checksum
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: "0.3.1" version: "0.3.1"
checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8" checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8"
@@ -40,7 +40,7 @@ The `archive_format` field is currently ignored.
```yaml ```yaml
- name: Use a custom manifest file - name: Use a custom manifest file
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
manifest-file: "https://example.com/my-custom-manifest.ndjson" manifest-file: "https://example.com/my-custom-manifest.ndjson"
``` ```
@@ -59,7 +59,7 @@ You can disable this by setting the `add-problem-matchers` input to `false`.
```yaml ```yaml
- name: Install the latest version of uv without problem matchers - name: Install the latest version of uv without problem matchers
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
add-problem-matchers: false add-problem-matchers: false
``` ```

View File

@@ -9,7 +9,7 @@ This allows directly using it in later steps:
```yaml ```yaml
- name: Install the latest version of uv and activate the environment - name: Install the latest version of uv and activate the environment
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
activate-environment: true activate-environment: true
- run: uv pip install pip - run: uv pip install pip
@@ -32,7 +32,7 @@ key: build-${{ runner.os }}-${{ runner.arch }}-${{ steps.setup-uv.outputs.python
You can customize the venv location with `venv-path`, for example to place it in the runner temp directory: You can customize the venv location with `venv-path`, for example to place it in the runner temp directory:
```yaml ```yaml
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 - uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
activate-environment: true activate-environment: true
venv-path: ${{ runner.temp }}/custom-venv venv-path: ${{ runner.temp }}/custom-venv
@@ -63,7 +63,7 @@ are not sufficient, you can provide a custom GitHub token with the necessary per
```yaml ```yaml
- name: Install the latest version of uv with a custom GitHub token - name: Install the latest version of uv with a custom GitHub token
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
``` ```
@@ -81,7 +81,7 @@ input:
```yaml ```yaml
- name: Install the latest version of uv with a custom tool dir - name: Install the latest version of uv with a custom tool dir
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
tool-dir: "/path/to/tool/dir" tool-dir: "/path/to/tool/dir"
``` ```
@@ -100,7 +100,7 @@ If you want to change this behaviour (especially on self-hosted runners) you can
```yaml ```yaml
- name: Install the latest version of uv with a custom tool bin dir - name: Install the latest version of uv with a custom tool bin dir
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
tool-bin-dir: "/path/to/tool-bin/dir" tool-bin-dir: "/path/to/tool-bin/dir"
``` ```
@@ -117,7 +117,7 @@ This action supports expanding the `~` character to the user's home directory fo
```yaml ```yaml
- name: Expand the tilde character - name: Expand the tilde character
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
cache-local-path: "~/path/to/cache" cache-local-path: "~/path/to/cache"
tool-dir: "~/path/to/tool/dir" tool-dir: "~/path/to/tool/dir"
@@ -134,7 +134,7 @@ If you want to ignore this, set the `ignore-empty-workdir` input to `true`.
```yaml ```yaml
- name: Ignore empty workdir - name: Ignore empty workdir
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
ignore-empty-workdir: true ignore-empty-workdir: true
``` ```
@@ -144,6 +144,7 @@ If you want to ignore this, set the `ignore-empty-workdir` input to `true`.
This action sets several environment variables that influence uv's behavior and can be used by subsequent steps: This action sets several environment variables that influence uv's behavior and can be used by subsequent steps:
- `UV_PYTHON`: Set when `python-version` is specified or the selected `.tool-versions` file contains a supported `python` entry. Controls which Python version uv uses. - `UV_PYTHON`: Set when `python-version` is specified or the selected `.tool-versions` file contains a supported `python` entry. Controls which Python version uv uses.
- `UV_PYTHON_ARCH`: Set when `python-arch` is specified. Controls the architecture of Python requests that do not specify one.
- `UV_CACHE_DIR`: Set when caching is enabled (unless already configured in uv config files). Controls where uv stores its cache. - `UV_CACHE_DIR`: Set when caching is enabled (unless already configured in uv config files). Controls where uv stores its cache.
- `UV_TOOL_DIR`: Set when `tool-dir` input is specified. Controls where uv installs tool environments. - `UV_TOOL_DIR`: Set when `tool-dir` input is specified. Controls where uv installs tool environments.
- `UV_TOOL_BIN_DIR`: Set when `tool-bin-dir` input is specified. Controls where uv installs tool binaries. - `UV_TOOL_BIN_DIR`: Set when `tool-bin-dir` input is specified. Controls where uv installs tool binaries.
@@ -155,10 +156,11 @@ This action sets several environment variables that influence uv's behavior and
- `UV_NO_MODIFY_PATH`: If set, prevents the action from modifying PATH. Cannot be used with `activate-environment`. - `UV_NO_MODIFY_PATH`: If set, prevents the action from modifying PATH. Cannot be used with `activate-environment`.
- `UV_CACHE_DIR`: If already set, the action will respect it instead of setting its own cache directory. - `UV_CACHE_DIR`: If already set, the action will respect it instead of setting its own cache directory.
- `UV_PYTHON`: If already set and `python-version` is not specified, the action will respect it instead of using the `python` entry from `.tool-versions`. - `UV_PYTHON`: If already set and `python-version` is not specified, the action will respect it instead of using the `python` entry from `.tool-versions`.
- `UV_PYTHON_ARCH`: If already set and `python-arch` is not specified, the action will use it and include it in the cache key. Requires a uv version that supports `UV_PYTHON_ARCH`.
```yaml ```yaml
- name: Example using environment variables - name: Example using environment variables
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
python-version: "3.12" python-version: "3.12"
tool-dir: "/custom/tool/dir" tool-dir: "/custom/tool/dir"

184
package-lock.json generated
View File

@@ -16,18 +16,18 @@
"@actions/io": "^3.0.2", "@actions/io": "^3.0.2",
"@actions/tool-cache": "^4.0.0", "@actions/tool-cache": "^4.0.0",
"@renovatebot/pep440": "^5.0.0", "@renovatebot/pep440": "^5.0.0",
"smol-toml": "^1.7.1", "smol-toml": "^1.8.0",
"undici": "^8.10.0" "undici": "^8.10.0"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^2.5.8", "@biomejs/biome": "^2.5.9",
"@types/js-yaml": "^4.0.9", "@types/js-yaml": "^4.0.9",
"@types/node": "^26.2.0", "@types/node": "^26.2.0",
"@types/semver": "^7.8.0", "@types/semver": "^7.8.0",
"@vercel/ncc": "^0.44.1", "@vercel/ncc": "^0.45.0",
"esbuild": "^0.28.2", "esbuild": "^0.28.2",
"jest": "^30.4.2", "jest": "^30.4.2",
"js-yaml": "^5.2.3", "js-yaml": "^5.3.0",
"ts-jest": "^29.4.11", "ts-jest": "^29.4.11",
"typescript": "^6.0.3" "typescript": "^6.0.3"
}, },
@@ -912,9 +912,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@biomejs/biome": { "node_modules/@biomejs/biome": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.9.tgz",
"integrity": "sha512-aeAeeJB9fSDc7Gq+2GqpQxA0qBj6gj1k2R6L1cYqGePKP/baIq1WX8y6B+D+nRsO5ViQL22K/8IwbqERW0q1nw==", "integrity": "sha512-KkgCvdHB4IhtpHpF564plA9jo6fDOwWGQ/3jvreLzgOtRLEDoPqr7QO9qejNA8jKwDsSkAKr77hqBHnyUbIw4g==",
"dev": true, "dev": true,
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"bin": { "bin": {
@@ -928,20 +928,20 @@
"url": "https://opencollective.com/biome" "url": "https://opencollective.com/biome"
}, },
"optionalDependencies": { "optionalDependencies": {
"@biomejs/cli-darwin-arm64": "2.5.8", "@biomejs/cli-darwin-arm64": "2.5.9",
"@biomejs/cli-darwin-x64": "2.5.8", "@biomejs/cli-darwin-x64": "2.5.9",
"@biomejs/cli-linux-arm64": "2.5.8", "@biomejs/cli-linux-arm64": "2.5.9",
"@biomejs/cli-linux-arm64-musl": "2.5.8", "@biomejs/cli-linux-arm64-musl": "2.5.9",
"@biomejs/cli-linux-x64": "2.5.8", "@biomejs/cli-linux-x64": "2.5.9",
"@biomejs/cli-linux-x64-musl": "2.5.8", "@biomejs/cli-linux-x64-musl": "2.5.9",
"@biomejs/cli-win32-arm64": "2.5.8", "@biomejs/cli-win32-arm64": "2.5.9",
"@biomejs/cli-win32-x64": "2.5.8" "@biomejs/cli-win32-x64": "2.5.9"
} }
}, },
"node_modules/@biomejs/cli-darwin-arm64": { "node_modules/@biomejs/cli-darwin-arm64": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.9.tgz",
"integrity": "sha512-mk1QON9PHllvvLN5gU3f4rMxeh4syK5p9OvKyWH6/W8ueh04uaC8TUXXByhGufWf/y5mQc03ZLM45zU+cmqMjA==", "integrity": "sha512-am22pX2aBqznqq1eMyIj/bZ++riF3Lk6ct7cbv+gQK0csFhr+d8O0RkOi2FF2qSgFgANbqNkIZ0/PxlnW2pLFg==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@@ -956,9 +956,9 @@
} }
}, },
"node_modules/@biomejs/cli-darwin-x64": { "node_modules/@biomejs/cli-darwin-x64": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.9.tgz",
"integrity": "sha512-bsGwFMBNyHPyiLSsQcZJxdoRrg1V4JL+d7wEsvUBczlP9U9lwM+7mzQHxI4o1mhBsTmdOBbAb6fHU3Z3snN45w==", "integrity": "sha512-l44KWDHLDvEnD0N/XcrVs7VXb3A18xL7QS3WB0eL93wbmk529ffIG55vleGCqaunpRUjLrdnjK05Qki1dsjylg==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@@ -973,9 +973,9 @@
} }
}, },
"node_modules/@biomejs/cli-linux-arm64": { "node_modules/@biomejs/cli-linux-arm64": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.9.tgz",
"integrity": "sha512-XmFiA0WPYFC+uiUDC8WRFzAIH9bo7vwQLav38Uoq4ETC+T/+uBi0TsYGJECkugY3r8USl3jc+Ae2/irAF6F2lQ==", "integrity": "sha512-ICaK+IYaVZvKbBxX2rwrPT0DdUDMnE9Vm3nQGe+mltQPmUg19pONzkPWGdY4FCsoreDETWDynvdt4ysCbF5gNQ==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@@ -990,9 +990,9 @@
} }
}, },
"node_modules/@biomejs/cli-linux-arm64-musl": { "node_modules/@biomejs/cli-linux-arm64-musl": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.9.tgz",
"integrity": "sha512-VcJNbstduTHx83NGAdhp78/JOcP45BZHXL7yNsfI1uGzdUgegAz2s+mSoT7wK6PBNzLoqG0zDOXaz/RQYVtSiw==", "integrity": "sha512-7ImVPwBLCtkmpR5esd8RHhTqW94f0JLJQum6AneYcy94jRm18TaPPm7slaigGzFhfgt3QiD1Vj52LKmBAnKizA==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@@ -1007,9 +1007,9 @@
} }
}, },
"node_modules/@biomejs/cli-linux-x64": { "node_modules/@biomejs/cli-linux-x64": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.9.tgz",
"integrity": "sha512-S5wcm9OBDvLHodD4PUaN488hCpco9QD/9ZxuYJiw4euWtr/oQvLR72z2ixItH8Wd5BCm6FZaeb+YNvOoM1xHtQ==", "integrity": "sha512-z22Q/zFYSvbIJfW1CbfZPu4X8PddS6Qd2ORbc6h+aT6EcwAxUF3m6fA4HjNvA3TU4X0dTJRwNPB165ES3PJXzg==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@@ -1024,9 +1024,9 @@
} }
}, },
"node_modules/@biomejs/cli-linux-x64-musl": { "node_modules/@biomejs/cli-linux-x64-musl": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.9.tgz",
"integrity": "sha512-kKmiyokeISRGq2FLwvr+TzsgBusfxaZ0FZNLcOYOpCK/78tRrEjeEBLvq3xLZMpqbANgJdRPI7vZX8ZL37u9/w==", "integrity": "sha512-RXGaD0o1/pTTguYw1aeDJh9ad6Lfrui0fI7mBderTyGr7WuUJkBIttgLkR3XJyoxOkkgfBDspaUT8wXArTqLZw==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@@ -1041,9 +1041,9 @@
} }
}, },
"node_modules/@biomejs/cli-win32-arm64": { "node_modules/@biomejs/cli-win32-arm64": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.9.tgz",
"integrity": "sha512-nILH0mzm3Hi3iEdd7o7GpB8kBR/mSQwfQG/tyBqyNrY2GFtcgwfV9nV8xLmbtUpMNY/Oi0Ml1XgfR4flOdq+AA==", "integrity": "sha512-nHK+/HHC+D0ogAHUxomgoSTdjImb6fmNNVTKmf0tyu4eDL1DqPKIHc+i+UL8+b0RnAu8224qo8F2tCVnaT0A3w==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@@ -1058,9 +1058,9 @@
} }
}, },
"node_modules/@biomejs/cli-win32-x64": { "node_modules/@biomejs/cli-win32-x64": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.9.tgz",
"integrity": "sha512-I2czzXTY61f3nFJxXoMDq80t7MivxDEnCjE+8sDKoFfcKMaoQdkqhIFQ3KyY0XLzeSpUBYeNAXgD+iOV/BU0VA==", "integrity": "sha512-Yiq0H56LjXSSw/hd9YkXgSLQfzyDJzbzU2TezozxyNw+uKWAqOtqGVvBfzKRRDiaFF5avGAhHdWKx7LtDOShUw==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@@ -2569,9 +2569,9 @@
] ]
}, },
"node_modules/@vercel/ncc": { "node_modules/@vercel/ncc": {
"version": "0.44.1", "version": "0.45.0",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.44.1.tgz", "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.45.0.tgz",
"integrity": "sha512-cUjIE5P2YY1n+Kt9rFIazMMpGoPn1Fic04rOmTkElMkiDP5oszGfERMpo2shVkFKDL7rVppdM2pqJKC59shQWQ==", "integrity": "sha512-8zPi1yO2mHpoKTD+e+Bf0ZT3e+sWHSOyGapm9s7b5R0gxJi3CiFTqmeQiMEyu6ejrz2s09M8JkEoUaTWjBJPQQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"bin": { "bin": {
@@ -4414,9 +4414,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/js-yaml": { "node_modules/js-yaml": {
"version": "5.2.3", "version": "5.3.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.3.tgz", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.3.0.tgz",
"integrity": "sha512-n+mUVyUX5bVv7G/G2zyIHOhdxfuU1dY2NOFzTQUWiMUbFss8b57NFlgCCaggU78wSw5KVS9cllzeLyzyR+n5nw==", "integrity": "sha512-muutsYr+e2+d3rTgUGslq5rxbBlUy3cJ61IsHag2QNDQV+7zXWjkUpmALIajhrlLlrgRUiymj6U3zUr/TMK84Q==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -5043,9 +5043,9 @@
} }
}, },
"node_modules/smol-toml": { "node_modules/smol-toml": {
"version": "1.7.1", "version": "1.8.0",
"resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.7.1.tgz", "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.8.0.tgz",
"integrity": "sha512-PPlsspAZ4jbMBu5DMFhfUGDQLu/vrL4SyBROVS37x8ynnVmFIs1VPBz1Co8Xks3TvpIaZXmU85y4DrQ+UyVFoQ==", "integrity": "sha512-kCZr2V3ch9i00x8zXRhjUNVcjG9ijES5dDudkXvUVCT5QlJNQWElSJdZqyPemffHoLNUYwOcou0Fy+ojN0uHSQ==",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"engines": { "engines": {
"node": ">= 18" "node": ">= 18"
@@ -6458,74 +6458,74 @@
"dev": true "dev": true
}, },
"@biomejs/biome": { "@biomejs/biome": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.9.tgz",
"integrity": "sha512-aeAeeJB9fSDc7Gq+2GqpQxA0qBj6gj1k2R6L1cYqGePKP/baIq1WX8y6B+D+nRsO5ViQL22K/8IwbqERW0q1nw==", "integrity": "sha512-KkgCvdHB4IhtpHpF564plA9jo6fDOwWGQ/3jvreLzgOtRLEDoPqr7QO9qejNA8jKwDsSkAKr77hqBHnyUbIw4g==",
"dev": true, "dev": true,
"requires": { "requires": {
"@biomejs/cli-darwin-arm64": "2.5.8", "@biomejs/cli-darwin-arm64": "2.5.9",
"@biomejs/cli-darwin-x64": "2.5.8", "@biomejs/cli-darwin-x64": "2.5.9",
"@biomejs/cli-linux-arm64": "2.5.8", "@biomejs/cli-linux-arm64": "2.5.9",
"@biomejs/cli-linux-arm64-musl": "2.5.8", "@biomejs/cli-linux-arm64-musl": "2.5.9",
"@biomejs/cli-linux-x64": "2.5.8", "@biomejs/cli-linux-x64": "2.5.9",
"@biomejs/cli-linux-x64-musl": "2.5.8", "@biomejs/cli-linux-x64-musl": "2.5.9",
"@biomejs/cli-win32-arm64": "2.5.8", "@biomejs/cli-win32-arm64": "2.5.9",
"@biomejs/cli-win32-x64": "2.5.8" "@biomejs/cli-win32-x64": "2.5.9"
} }
}, },
"@biomejs/cli-darwin-arm64": { "@biomejs/cli-darwin-arm64": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.9.tgz",
"integrity": "sha512-mk1QON9PHllvvLN5gU3f4rMxeh4syK5p9OvKyWH6/W8ueh04uaC8TUXXByhGufWf/y5mQc03ZLM45zU+cmqMjA==", "integrity": "sha512-am22pX2aBqznqq1eMyIj/bZ++riF3Lk6ct7cbv+gQK0csFhr+d8O0RkOi2FF2qSgFgANbqNkIZ0/PxlnW2pLFg==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"@biomejs/cli-darwin-x64": { "@biomejs/cli-darwin-x64": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.9.tgz",
"integrity": "sha512-bsGwFMBNyHPyiLSsQcZJxdoRrg1V4JL+d7wEsvUBczlP9U9lwM+7mzQHxI4o1mhBsTmdOBbAb6fHU3Z3snN45w==", "integrity": "sha512-l44KWDHLDvEnD0N/XcrVs7VXb3A18xL7QS3WB0eL93wbmk529ffIG55vleGCqaunpRUjLrdnjK05Qki1dsjylg==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"@biomejs/cli-linux-arm64": { "@biomejs/cli-linux-arm64": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.9.tgz",
"integrity": "sha512-XmFiA0WPYFC+uiUDC8WRFzAIH9bo7vwQLav38Uoq4ETC+T/+uBi0TsYGJECkugY3r8USl3jc+Ae2/irAF6F2lQ==", "integrity": "sha512-ICaK+IYaVZvKbBxX2rwrPT0DdUDMnE9Vm3nQGe+mltQPmUg19pONzkPWGdY4FCsoreDETWDynvdt4ysCbF5gNQ==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"@biomejs/cli-linux-arm64-musl": { "@biomejs/cli-linux-arm64-musl": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.9.tgz",
"integrity": "sha512-VcJNbstduTHx83NGAdhp78/JOcP45BZHXL7yNsfI1uGzdUgegAz2s+mSoT7wK6PBNzLoqG0zDOXaz/RQYVtSiw==", "integrity": "sha512-7ImVPwBLCtkmpR5esd8RHhTqW94f0JLJQum6AneYcy94jRm18TaPPm7slaigGzFhfgt3QiD1Vj52LKmBAnKizA==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"@biomejs/cli-linux-x64": { "@biomejs/cli-linux-x64": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.9.tgz",
"integrity": "sha512-S5wcm9OBDvLHodD4PUaN488hCpco9QD/9ZxuYJiw4euWtr/oQvLR72z2ixItH8Wd5BCm6FZaeb+YNvOoM1xHtQ==", "integrity": "sha512-z22Q/zFYSvbIJfW1CbfZPu4X8PddS6Qd2ORbc6h+aT6EcwAxUF3m6fA4HjNvA3TU4X0dTJRwNPB165ES3PJXzg==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"@biomejs/cli-linux-x64-musl": { "@biomejs/cli-linux-x64-musl": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.9.tgz",
"integrity": "sha512-kKmiyokeISRGq2FLwvr+TzsgBusfxaZ0FZNLcOYOpCK/78tRrEjeEBLvq3xLZMpqbANgJdRPI7vZX8ZL37u9/w==", "integrity": "sha512-RXGaD0o1/pTTguYw1aeDJh9ad6Lfrui0fI7mBderTyGr7WuUJkBIttgLkR3XJyoxOkkgfBDspaUT8wXArTqLZw==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"@biomejs/cli-win32-arm64": { "@biomejs/cli-win32-arm64": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.9.tgz",
"integrity": "sha512-nILH0mzm3Hi3iEdd7o7GpB8kBR/mSQwfQG/tyBqyNrY2GFtcgwfV9nV8xLmbtUpMNY/Oi0Ml1XgfR4flOdq+AA==", "integrity": "sha512-nHK+/HHC+D0ogAHUxomgoSTdjImb6fmNNVTKmf0tyu4eDL1DqPKIHc+i+UL8+b0RnAu8224qo8F2tCVnaT0A3w==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"@biomejs/cli-win32-x64": { "@biomejs/cli-win32-x64": {
"version": "2.5.8", "version": "2.5.9",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.8.tgz", "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.9.tgz",
"integrity": "sha512-I2czzXTY61f3nFJxXoMDq80t7MivxDEnCjE+8sDKoFfcKMaoQdkqhIFQ3KyY0XLzeSpUBYeNAXgD+iOV/BU0VA==", "integrity": "sha512-Yiq0H56LjXSSw/hd9YkXgSLQfzyDJzbzU2TezozxyNw+uKWAqOtqGVvBfzKRRDiaFF5avGAhHdWKx7LtDOShUw==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
@@ -7445,9 +7445,9 @@
"optional": true "optional": true
}, },
"@vercel/ncc": { "@vercel/ncc": {
"version": "0.44.1", "version": "0.45.0",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.44.1.tgz", "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.45.0.tgz",
"integrity": "sha512-cUjIE5P2YY1n+Kt9rFIazMMpGoPn1Fic04rOmTkElMkiDP5oszGfERMpo2shVkFKDL7rVppdM2pqJKC59shQWQ==", "integrity": "sha512-8zPi1yO2mHpoKTD+e+Bf0ZT3e+sWHSOyGapm9s7b5R0gxJi3CiFTqmeQiMEyu6ejrz2s09M8JkEoUaTWjBJPQQ==",
"dev": true "dev": true
}, },
"agent-base": { "agent-base": {
@@ -8708,9 +8708,9 @@
"dev": true "dev": true
}, },
"js-yaml": { "js-yaml": {
"version": "5.2.3", "version": "5.3.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.3.tgz", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.3.0.tgz",
"integrity": "sha512-n+mUVyUX5bVv7G/G2zyIHOhdxfuU1dY2NOFzTQUWiMUbFss8b57NFlgCCaggU78wSw5KVS9cllzeLyzyR+n5nw==", "integrity": "sha512-muutsYr+e2+d3rTgUGslq5rxbBlUy3cJ61IsHag2QNDQV+7zXWjkUpmALIajhrlLlrgRUiymj6U3zUr/TMK84Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"argparse": "^2.0.1" "argparse": "^2.0.1"
@@ -9116,9 +9116,9 @@
"dev": true "dev": true
}, },
"smol-toml": { "smol-toml": {
"version": "1.7.1", "version": "1.8.0",
"resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.7.1.tgz", "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.8.0.tgz",
"integrity": "sha512-PPlsspAZ4jbMBu5DMFhfUGDQLu/vrL4SyBROVS37x8ynnVmFIs1VPBz1Co8Xks3TvpIaZXmU85y4DrQ+UyVFoQ==" "integrity": "sha512-kCZr2V3ch9i00x8zXRhjUNVcjG9ijES5dDudkXvUVCT5QlJNQWElSJdZqyPemffHoLNUYwOcou0Fy+ojN0uHSQ=="
}, },
"source-map": { "source-map": {
"version": "0.6.1", "version": "0.6.1",

View File

@@ -45,18 +45,18 @@
"@actions/io": "^3.0.2", "@actions/io": "^3.0.2",
"@actions/tool-cache": "^4.0.0", "@actions/tool-cache": "^4.0.0",
"@renovatebot/pep440": "^5.0.0", "@renovatebot/pep440": "^5.0.0",
"smol-toml": "^1.7.1", "smol-toml": "^1.8.0",
"undici": "^8.10.0" "undici": "^8.10.0"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^2.5.8", "@biomejs/biome": "^2.5.9",
"@types/js-yaml": "^4.0.9", "@types/js-yaml": "^4.0.9",
"@types/node": "^26.2.0", "@types/node": "^26.2.0",
"@types/semver": "^7.8.0", "@types/semver": "^7.8.0",
"@vercel/ncc": "^0.44.1", "@vercel/ncc": "^0.45.0",
"esbuild": "^0.28.2", "esbuild": "^0.28.2",
"jest": "^30.4.2", "jest": "^30.4.2",
"js-yaml": "^5.2.3", "js-yaml": "^5.3.0",
"ts-jest": "^29.4.11", "ts-jest": "^29.4.11",
"typescript": "^6.0.3" "typescript": "^6.0.3"
} }

View File

@@ -1,7 +1,7 @@
import * as cache from "@actions/cache"; import * as cache from "@actions/cache";
import * as core from "@actions/core"; import * as core from "@actions/core";
import { hashFiles } from "../hash/hash-files"; import { hashFiles } from "../hash/hash-files";
import type { SetupInputs } from "../utils/inputs"; import { resolvePythonArch, type SetupInputs } from "../utils/inputs";
import * as log from "../utils/logging"; import * as log from "../utils/logging";
import { getArch, getOSNameVersion, getPlatform } from "../utils/platforms"; import { getArch, getOSNameVersion, getPlatform } from "../utils/platforms";
@@ -98,11 +98,15 @@ async function computeKeys(
? `-${encodeURIComponent(inputs.cacheSuffix)}` ? `-${encodeURIComponent(inputs.cacheSuffix)}`
: ""; : "";
const version = encodeURIComponent(pythonVersion ?? "unknown"); const version = encodeURIComponent(pythonVersion ?? "unknown");
const pythonArch = resolvePythonArch(inputs.pythonArch);
const pythonArchKey = pythonArch
? `-python-${encodeURIComponent(pythonArch)}`
: "";
const platform = await getPlatform(); const platform = await getPlatform();
const osNameVersion = getOSNameVersion(); const osNameVersion = getOSNameVersion();
const pruned = inputs.pruneCache ? "-pruned" : ""; const pruned = inputs.pruneCache ? "-pruned" : "";
const python = inputs.cachePython ? "-py" : ""; const python = inputs.cachePython ? "-py" : "";
return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform}-${osNameVersion}-${version}${pruned}${python}${cacheDependencyPathHash}${suffix}`; return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform}-${osNameVersion}-${version}${pythonArchKey}${pruned}${python}${cacheDependencyPathHash}${suffix}`;
} }
function handleMatchResult( function handleMatchResult(

View File

@@ -1,4 +1,148 @@
{ {
"aarch64-apple-darwin-0.12.20": "848fdeb602ff1a1baacd4f6c8b7bdc6cf1ad026a6d9cf59475fda17c179743ca",
"aarch64-pc-windows-msvc-0.12.20": "b6bd9218855591742ffd3b00fcf2044b4d2fb6446b6a3545e0dfee447e950388",
"aarch64-unknown-linux-gnu-0.12.20": "8a7aad7bc76a2fae5151566ff3e43eacce0b2a113d5e4de3e4afe3e58fa2441e",
"aarch64-unknown-linux-musl-0.12.20": "94bb13feeebc6b59a4124016c957cdc9ee406d1476ce2b2ce2991e95b8e820b7",
"arm-unknown-linux-musleabihf-0.12.20": "6aeef64cf07b43135d6b1c20bd57809f2d965d0f8a2d5602230d5d55b8245477",
"armv7-unknown-linux-gnueabihf-0.12.20": "e1c53318608448ad3b8e7f2e9b069936730a6e7b47831ba5446e4b4f436ee715",
"armv7-unknown-linux-musleabihf-0.12.20": "a4c3a0e12e5489f092c93b232ddc4a811a6ea9a03f447f91f88e96867c0bac8d",
"i686-pc-windows-msvc-0.12.20": "1a372c273370ae9a7e9aa84020ce91fc1d9ebecbd287c3447e7e99cada0b14f3",
"i686-unknown-linux-gnu-0.12.20": "f1e83cc88970ed799b507a8392152d19916dfa0b6c9ae9c8145742035a40d5cb",
"i686-unknown-linux-musl-0.12.20": "11d541dd32dd779adbdfef69fe30d7d325036f50d394d3f260a0042998e05499",
"powerpc64le-unknown-linux-gnu-0.12.20": "39224a5bfc21a8041afc0315e5d47c86acecf4e669944564950996b516fb5987",
"riscv64gc-unknown-linux-gnu-0.12.20": "5cb9df36ca64fb72673c59a77b955b50f3bb907689a98d1d8d640aa3e71f2660",
"riscv64gc-unknown-linux-musl-0.12.20": "360e91a317a27bd33978577c57b6f3ed778bdfe8c30c9b613e46fdc33bf8aee8",
"s390x-unknown-linux-gnu-0.12.20": "25485439b52cb029afa724c442418ca08a53122100f8cce68ccceb88323ccde2",
"x86_64-apple-darwin-0.12.20": "ac54283d211fd77cdc152b67606dbaf6406ff4ab03f3af4ae99468fa8e887141",
"x86_64-pc-windows-msvc-0.12.20": "95f9bc30fbb3574d276e28ac4a6de932d25153645853d13da8c21eec3bc88d06",
"x86_64-unknown-linux-gnu-0.12.20": "6590717592ace991ff83a63fef799e3ad9d33ecc8f96c5d6bdd732496e79337f",
"x86_64-unknown-linux-musl-0.12.20": "14114d66a094f1907af0fcbc863f34226bbb7f5e430e13dce6676ba40dcc6891",
"aarch64-apple-darwin-0.12.19": "a9a8df1eedeb192f2e47e40e2faabfb387db4b850209118786d42f89dde3e0ba",
"aarch64-pc-windows-msvc-0.12.19": "115b54cb823bc48260670f5782001add6067ac8d98d18c8263a833704e287de9",
"aarch64-unknown-linux-gnu-0.12.19": "0804e9b164c64b6914182d5920c08551958a095986f10a3731056df701126436",
"aarch64-unknown-linux-musl-0.12.19": "ad8d8448a2ff642ba62c2f684d7dd22a03f8eb3fc9918c2c3e8ec975f4ed6710",
"arm-unknown-linux-musleabihf-0.12.19": "173b6b118e444dc3b3a0b6337dd87d66fa79835aa5e059d79e942ae33a850e20",
"armv7-unknown-linux-gnueabihf-0.12.19": "f47fe74244c4adcff20637c1aee2550dbc31c81ccf0b2a9537bf98b24bc4028a",
"armv7-unknown-linux-musleabihf-0.12.19": "0df353aac087509c47fe660837ca5d284858ef4a5eec4042cbcdeb0118ba0f1b",
"i686-pc-windows-msvc-0.12.19": "e1c2d19d1173a0e9f81ba3f95881ad741808133e372610889ff6870629218c7f",
"i686-unknown-linux-gnu-0.12.19": "952b0bae707e19b2b5d012b46519a2159be929273d466a1437759f0961be0b93",
"i686-unknown-linux-musl-0.12.19": "f923ac32e0e5139950fe1b63abab74d48cabb94b15c90637bc380dadcaf4da40",
"powerpc64le-unknown-linux-gnu-0.12.19": "e30649ad846a14bd96440efd45fdb60dcdf8db088fb143064aa78632048ad957",
"riscv64gc-unknown-linux-gnu-0.12.19": "50a83ea999ea861a6a853ae1ad0982baad96cc6451e46a5d7e366c4d9475f1bb",
"riscv64gc-unknown-linux-musl-0.12.19": "051de9eda7e09dab4c8a304ab2e119317649fee0e24efd0358f410d0c5b3407f",
"s390x-unknown-linux-gnu-0.12.19": "e6a9149ea122c1b3b9719ca3577c321376e3c400e004c3cc18231fdb1d35107b",
"x86_64-apple-darwin-0.12.19": "cb5fa57bafe68fc0fb94b17f06bee0b0b9a7feb94ccbd110445afa0696e39273",
"x86_64-pc-windows-msvc-0.12.19": "6dbb02d79e419522f1c500f0adb1cddcff0cda7d59b0d66ea7f5e3b4a1b2f5f0",
"x86_64-unknown-linux-gnu-0.12.19": "23bf5552d220e0842b65c862097b2ebaeba0064b74eda5e565e77fd25969d8c8",
"x86_64-unknown-linux-musl-0.12.19": "db7278c9f57981338fddff1fb250e11964bc0a4fafcb9eed8303fdb117dc067b",
"aarch64-apple-darwin-0.12.18": "cf40e0c6a202190ccd9e0406dcfdd5b2d6668a9a5c779b17948963df32aafe5b",
"aarch64-pc-windows-msvc-0.12.18": "17f27b1c64eacc757ae603579f116a014881e486c5e79ae81877980d4699e943",
"aarch64-unknown-linux-gnu-0.12.18": "afb6291f3f0a6b4521fc67b947822506c41dde5b60d2189dd8f3695b2ac8c9e7",
"aarch64-unknown-linux-musl-0.12.18": "0796973fb3eea8095078c3d0659bd17a5f6789a71b8dd85caff2483178f78ac3",
"arm-unknown-linux-musleabihf-0.12.18": "a37127fb331d5e6228efc1f8549d2447b50c907eee4629347f150a649083619c",
"armv7-unknown-linux-gnueabihf-0.12.18": "a38e82350e1e95d5526d1ab81d9b4eb676815c51646243b3b3fbc55b218732d1",
"armv7-unknown-linux-musleabihf-0.12.18": "41f0808328f65910bacdb487638475715f949900c7a23b393b3754e2156ff15a",
"i686-pc-windows-msvc-0.12.18": "e04c0f1fd9a8703761f9edd64d797ddb2c9a3e6eec0e2fed234a7bd2c2e868b9",
"i686-unknown-linux-gnu-0.12.18": "278dbc5dfc6bdde33a553fdba53174cc49daf512a857db1b3c1b5d663290196f",
"i686-unknown-linux-musl-0.12.18": "ebfdaaafc447fb2a7329cde879a7748b2ab40ecdcd3d5f04fc0a5d1ab79bb0bd",
"powerpc64le-unknown-linux-gnu-0.12.18": "332d174248230ed599a9df0e4e77d6921dbb42ca0fdfbe26eb2a6c999da936b3",
"riscv64gc-unknown-linux-gnu-0.12.18": "be88652a03225acbd6bf7204d006b244b0743c8c756a35137c209fa4ff731c41",
"riscv64gc-unknown-linux-musl-0.12.18": "29d34dcc833b99b09f78fa11c66fa3c490c3e37c4f0d754e7b84f7147850190e",
"s390x-unknown-linux-gnu-0.12.18": "ac412f7ab2a096a7302e0ae8828c7ef84db8a1f7ff97acba8ff8987d46d39cec",
"x86_64-apple-darwin-0.12.18": "2e4108f5395397c8bc5d43bf83d3bdbb2d0e92b90d0efa607756be704905fa33",
"x86_64-pc-windows-msvc-0.12.18": "cae6a3bc25239f83dffb467a4b180508d9da23986c04639ebfa44e43e6a84bff",
"x86_64-unknown-linux-gnu-0.12.18": "89eadd7c76fc063887959510d5ba0ab1264dfd5f1143b925ddb73021a40acf16",
"x86_64-unknown-linux-musl-0.12.18": "e38d97460b98ebfd31b197de0fe9fa578add4bc8ba0179b203dd3f87b99f98e6",
"aarch64-apple-darwin-0.12.17": "85f00cbdc6dd3e97eba4c31b4d014375a9fdfe8f570023b84e5102fc3456896b",
"aarch64-pc-windows-msvc-0.12.17": "3e1aa6849d77f0e00dc865e4afab5c5b32de053e21fe35bf5ad5cec3734ec976",
"aarch64-unknown-linux-gnu-0.12.17": "d636d1b678e9e7f367ecb22b46bd1cabbed234d6bc3b4d96365d2b507f72f86c",
"aarch64-unknown-linux-musl-0.12.17": "a6096da273d548cb9f277d237a01ac7344a39ef0f455c0e148e4dc9737c1596b",
"arm-unknown-linux-musleabihf-0.12.17": "16a98a65ef8545f7c32cf717683aac44248369ffaa41c43e665341489359c654",
"armv7-unknown-linux-gnueabihf-0.12.17": "796e101976e18a0f92d90b6f3efd289f77fbc5afd1aaa6fdedd3c84c209eabab",
"armv7-unknown-linux-musleabihf-0.12.17": "421c5f9c53d49088e705e7a64fea147082a2191178ea1d8c51d9ad758ca899f6",
"i686-pc-windows-msvc-0.12.17": "1d3653cb6eafd1e675e979d7cd8eeac1456202f8927a2216419993077a4c473f",
"i686-unknown-linux-gnu-0.12.17": "3faa79a70e2a1aa6eb3cd78eba02263f3e4b17b6be584a01429968f92ff74966",
"i686-unknown-linux-musl-0.12.17": "fc05220cfa1c6585e0e209877c228393b25a96e17cd43028b06566ac894cd078",
"powerpc64le-unknown-linux-gnu-0.12.17": "eb6dbedaaa622af32cba2388e0d2d47e34c8724d4214a129d614b96f071d8e53",
"riscv64gc-unknown-linux-gnu-0.12.17": "65b807b24357133c49d97ca9394ee7e13ca62822e1095376c809654b35f39cf2",
"riscv64gc-unknown-linux-musl-0.12.17": "87c339a735b578f285b961bebdefe0a671f3652477d1e84dc69cd1a829f45e92",
"s390x-unknown-linux-gnu-0.12.17": "d99f69f47fc5e0975d6e7a5745cf2332317015caffb3bb81e5154cc7b66fa77a",
"x86_64-apple-darwin-0.12.17": "8dcf05a8c809bb3c471d2b614788ba27a6e41298fc8c31ac84b5f4339fd468e5",
"x86_64-pc-windows-msvc-0.12.17": "a252121d5b59398fcb137c6ea448176459a44010f33f67e0072305a637119ca7",
"x86_64-unknown-linux-gnu-0.12.17": "fa82fd8dde8e8eefdecada6aa0889666556cfceb690d06e0c3bca49eb3070a63",
"x86_64-unknown-linux-musl-0.12.17": "6401c4665d8fa2a9893e087c91f585430738e3170f5398a1141483efb4a93310",
"aarch64-apple-darwin-0.12.16": "b6e03fae61704b1aa622f12b792a69483e837b83068e44f4fd34f8a07a8f74a3",
"aarch64-pc-windows-msvc-0.12.16": "9977129f89c4036edfcb200d2484755571e51fa74517f02e478c1d7bcc353b2e",
"aarch64-unknown-linux-gnu-0.12.16": "36d913ee9c647481d64f1a0a0485f85ff2feaee605c341fc22e73398f9212c26",
"aarch64-unknown-linux-musl-0.12.16": "5beba1f35c0922fd086cce850ce919e55bc4e873c4fcda891343526afdb4c5b3",
"arm-unknown-linux-musleabihf-0.12.16": "d91fa9dede60e851e4bb3ae8060300042bc6bf924476fae71898d2c08c46a9cf",
"armv7-unknown-linux-gnueabihf-0.12.16": "fbdfca5d4ace4a5abbf343c0f10a0b68c5eac0201073d2a504e32c57c0873669",
"armv7-unknown-linux-musleabihf-0.12.16": "f5a3b6c7fbd4c7ea66cbd704d821ffed0d20abbfa8a12c2e68d6dd22476d308b",
"i686-pc-windows-msvc-0.12.16": "0d4889cc6c4058f4fbc28f6c50ec09b528ef998547cac5c3425e1a0b8169e847",
"i686-unknown-linux-gnu-0.12.16": "0e8743e653ed124c526a9e86ee6a08fa6eee7618a3f12cc9033c74674bd2047f",
"i686-unknown-linux-musl-0.12.16": "f609686cbe67884eeb57daebd58eb0fef35f930dd92fd2c14e931da7515c7454",
"powerpc64le-unknown-linux-gnu-0.12.16": "312dc82f441debff371fe5fc0068b538787678d6d79edc86f028b011920a2f6a",
"riscv64gc-unknown-linux-gnu-0.12.16": "8b0142eee9d291c602218126e3fc558fe9bc1b7c8f1cc0b03dcd8df9f2f218a1",
"riscv64gc-unknown-linux-musl-0.12.16": "188af30f025c35569b302b84793a4c286f6740902885d054917375edbfd0193c",
"s390x-unknown-linux-gnu-0.12.16": "b90cc954c2cd52b695104e215189a0c8d9e6ceaee753c9be1a871bb8d969e9c3",
"x86_64-apple-darwin-0.12.16": "a42bcc9ce97eb8b364d7f162233a9c6b8c0ee25388e551d362809795127e0c31",
"x86_64-pc-windows-msvc-0.12.16": "f730454bf09019754e5e5abd71a8aa18683cb739cba0d9c720bac2e7c901160f",
"x86_64-unknown-linux-gnu-0.12.16": "8e5c6e5523dffc2dcf615bd995554c84c9feb4e577808a3fb8698a639d3f8d9c",
"x86_64-unknown-linux-musl-0.12.16": "a01206ffbd60f3a7ee30949be1863527986f5307494a064042c69ce7e6d44799",
"aarch64-apple-darwin-0.12.15": "dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d",
"aarch64-pc-windows-msvc-0.12.15": "a37c8e96cb1260488c8510b64c848533a3a82a2fdf9e905de7c2700ceebf6437",
"aarch64-unknown-linux-gnu-0.12.15": "0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08",
"aarch64-unknown-linux-musl-0.12.15": "93b801abb146e6431fb0434346a0162e65d3f0d1cd7360144d04c43488fd7f7d",
"arm-unknown-linux-musleabihf-0.12.15": "9b0204dbd368a7a5f84d3ef015684c3b0e830911641ebf4575f44ad4901c1b3e",
"armv7-unknown-linux-gnueabihf-0.12.15": "a0afe9cfc7dc4acc18e613f68c5b010b849323b3a3d6e9311b29d289dc94f95e",
"armv7-unknown-linux-musleabihf-0.12.15": "a113c782e6f96a56f73aba601cde73ddbe877e0a4179eabeb5b6e86be9bb75d9",
"i686-pc-windows-msvc-0.12.15": "cc8b28f77cf19f7ed88569d6d9163e503ebc94e1b70069889852bcf38839c559",
"i686-unknown-linux-gnu-0.12.15": "6fa19118f01ee547d5b9a3f4af389c5c929a34e0074a4313d3cdb3ce9c97fdcd",
"i686-unknown-linux-musl-0.12.15": "b66d6cf7916addeda13fbb61abe003ecc62f048e3a213d6bd2494ca7e8022989",
"powerpc64le-unknown-linux-gnu-0.12.15": "5f49c97ae7ec25c45513466e00a32cacb148f3824367c7e498c0b53a270bc1e2",
"riscv64gc-unknown-linux-gnu-0.12.15": "4c8f75c5969737b67621957010df5337bb721a8d48fdbb1620f5d35c3f1dd268",
"riscv64gc-unknown-linux-musl-0.12.15": "8c03514f57e517eb87a376deb3d6475045f6ce550956c6082910b4a529d08a47",
"s390x-unknown-linux-gnu-0.12.15": "1f5701cb5eedc5a34d3dd5896ca3bf509b15d382b3448f370df46e0a631889c1",
"x86_64-apple-darwin-0.12.15": "e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b",
"x86_64-pc-windows-msvc-0.12.15": "477bd99a84e34891f2bd4c9152ddeb74e971accccbc59c0f0301f11f08a32d46",
"x86_64-unknown-linux-gnu-0.12.15": "f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638",
"x86_64-unknown-linux-musl-0.12.15": "999c0c3da986953e508985c3932d283d2c62eb167b4f8d81e79f565e34104959",
"aarch64-apple-darwin-0.12.14": "dfed5683c5873d65eff8476eb93526059b81e5646a68305b5c94a26b29990894",
"aarch64-pc-windows-msvc-0.12.14": "46b930bdbb338099c7d9da711b751240eb97876eda6a553a2c28323967232041",
"aarch64-unknown-linux-gnu-0.12.14": "7fb91bd5d10529c60723eaec3caf44726f89280e5aeed78af8fc63fcad004c9b",
"aarch64-unknown-linux-musl-0.12.14": "571b5c73c9bcc294f8087f22613edb7c7ceb191f4dbf8cafd3f2ff15e6147d36",
"arm-unknown-linux-musleabihf-0.12.14": "6e0df0e690d5c29ce65ec6962d8b262a93e9951077f05d78943f858e7d6e9185",
"armv7-unknown-linux-gnueabihf-0.12.14": "c20a18bb275a6fc2599bc321d37e52650a449237c6111da203a1d73b45921b25",
"armv7-unknown-linux-musleabihf-0.12.14": "a128725e1e40226a9309d603cbb4c36e272932092a77f4d0478ef2fb8eacaa05",
"i686-pc-windows-msvc-0.12.14": "ddd9afd789c60a38d82f3021239e22daacc67b9ef0719345ee6f0dcc37ab93ae",
"i686-unknown-linux-gnu-0.12.14": "de65ccdb90dd818248161db761ae3b6713b1b3230a1b55068ad327598b3a14b8",
"i686-unknown-linux-musl-0.12.14": "268538a3b90c90f7d68d31ed781f0f2cb8618188019c8bb09ce0e7876bb54829",
"powerpc64le-unknown-linux-gnu-0.12.14": "6a6c2a91d6240700eb36895c3fb0533bd5e9c696a95e0a55f7a7ae844cbde537",
"riscv64gc-unknown-linux-gnu-0.12.14": "df2c854c77b1d32f75ef08282511b050066b3db9d7abc4dc2c23ea26227c6b74",
"riscv64gc-unknown-linux-musl-0.12.14": "c6d0824ebdf23811dfa659148ae2c224b385d07ae1b4c282e5bf6abe3d603a74",
"s390x-unknown-linux-gnu-0.12.14": "e01aec9706c88f93f90409eab42324571e2b2c9c2938aaa266ad048b37c52c6f",
"x86_64-apple-darwin-0.12.14": "e11a70264ceca38e929ecaeed953c323e517af7b960ebf9722d5918e8c7f0375",
"x86_64-pc-windows-msvc-0.12.14": "02cecb254f37f3396da625680796d3990164a590fb5611d46f719ad83e7b9a89",
"x86_64-unknown-linux-gnu-0.12.14": "18ef5c3888ae59828cb13f38d57e9389b8173ecc719eff163bfafc74b38f5936",
"x86_64-unknown-linux-musl-0.12.14": "df163630683e5a2106d3320e2a448fde8eda5e7b9b47f617c5c332769728e735",
"aarch64-apple-darwin-0.12.13": "7e6ddb9316acc00f2296c82ff4d99977870ee34b2f0ddcae9444d714db9364ed",
"aarch64-pc-windows-msvc-0.12.13": "1efb2654b06e7063d4ac1fc9d49a9bda9a6704d82f035b589a2751a592f14151",
"aarch64-unknown-linux-gnu-0.12.13": "2eaa5d94f5db7b3a1a092156b9420459e42ab0217d917fe74a876309cef9b5e9",
"aarch64-unknown-linux-musl-0.12.13": "f44bc1037a17889fe562fffd2002d4ed108e499fbe68b4f022af244dc7b8244f",
"arm-unknown-linux-musleabihf-0.12.13": "2c7644f891edcf1e74a1b9dde96ea4ba00b41301c936c87e843683656703ada2",
"armv7-unknown-linux-gnueabihf-0.12.13": "19252c4d21fce112817b9e07bef6b2e9c90cef80fe82659533105b37a772d067",
"armv7-unknown-linux-musleabihf-0.12.13": "54e2c10e4e6c18a3efbac645ea02d7e6b768ae2f975275595915a7039e802b75",
"i686-pc-windows-msvc-0.12.13": "4ddcdf859d3bd337a156a2fc567e685e4b3d61e07b4a2dbbed7aeb4325e116ac",
"i686-unknown-linux-gnu-0.12.13": "beb56f6eda61bc69a8acc1bca07929365aa5cd2e912e35c35003a45e266d8a0e",
"i686-unknown-linux-musl-0.12.13": "6c93a9703b6145266240cb2aeb31d3574c21b33570fddf92461707b906eb3a65",
"powerpc64le-unknown-linux-gnu-0.12.13": "cd45ac73fc711e717602a4dc0c9e19d9c6563d15b14515a9a5dd49b00172a8b6",
"riscv64gc-unknown-linux-gnu-0.12.13": "ff1fb4d7e4c1d3a4acc6eff69b2530e846964260469df345e0239059517c0a21",
"riscv64gc-unknown-linux-musl-0.12.13": "b88312b410c1183e33ae9fa7738f35b7cd7396b2aa0e82836d7e88dbf23e5fb5",
"s390x-unknown-linux-gnu-0.12.13": "d41e4784c2187c76970690a9e9a288231f5ec8d2160ad8464be74aa9c06717e8",
"x86_64-apple-darwin-0.12.13": "5e287ef61cb6a9b61b3a83fef124fd143e400468a7dac794230147a810e17119",
"x86_64-pc-windows-msvc-0.12.13": "a86c9dc7bad9b03f388583b7187c05fe9951c2e0d392217e8fd43d97787f6ec2",
"x86_64-unknown-linux-gnu-0.12.13": "745765a3b6e360ad76743599ae5c42e9278c7edf8bbff9fc76d05bf2623a04dd",
"x86_64-unknown-linux-musl-0.12.13": "4e2bfd0c9007b1032a50e539e965fd0a6037d87ad93ae1580d220a92d4c94098",
"aarch64-apple-darwin-0.12.12": "46740540b63fdee9a6cb2e19baf3f1f475b850c440a33e63455087a6871263f1", "aarch64-apple-darwin-0.12.12": "46740540b63fdee9a6cb2e19baf3f1f475b850c440a33e63455087a6871263f1",
"aarch64-pc-windows-msvc-0.12.12": "36559da51ecee83b2b1d80aa1a0ede2f80e2d9e5761fffcbb9e9366a7f3d022a", "aarch64-pc-windows-msvc-0.12.12": "36559da51ecee83b2b1d80aa1a0ede2f80e2d9e5761fffcbb9e9366a7f3d022a",
"aarch64-unknown-linux-gnu-0.12.12": "fe08db50cc1b56cd1da7801065ed1103d27ed3f9571cd122386cfc7faf1b8df5", "aarch64-unknown-linux-gnu-0.12.12": "fe08db50cc1b56cd1da7801065ed1103d27ed3f9571cd122386cfc7faf1b8df5",

View File

@@ -16,6 +16,7 @@ import {
getPlatform, getPlatform,
type Platform, type Platform,
} from "./utils/platforms"; } from "./utils/platforms";
import { setupPythonArch } from "./utils/python-arch";
import { getPythonRuntimeId } from "./utils/python-runtime"; import { getPythonRuntimeId } from "./utils/python-runtime";
import { resolveUvVersion } from "./version/resolve"; import { resolveUvVersion } from "./version/resolve";
@@ -86,6 +87,11 @@ async function run(): Promise<void> {
throw new Error(`Unsupported architecture: ${process.arch}`); throw new Error(`Unsupported architecture: ${process.arch}`);
} }
const setupResult = await setupUv(inputs, platform, arch); const setupResult = await setupUv(inputs, platform, arch);
const uvPath = path.join(
setupResult.uvDir,
process.platform === "win32" ? "uv.exe" : "uv",
);
await setupPythonArch(uvPath, inputs.pythonArch);
addToolBinToPath(inputs); addToolBinToPath(inputs);
addUvToPathAndOutput(setupResult.uvDir); addUvToPathAndOutput(setupResult.uvDir);

View File

@@ -24,6 +24,7 @@ export interface SetupInputs {
version: string; version: string;
versionFile: string; versionFile: string;
pythonVersion: string; pythonVersion: string;
pythonArch: string;
activateEnvironment: boolean; activateEnvironment: boolean;
noProject: boolean; noProject: boolean;
venvPath: string; venvPath: string;
@@ -54,13 +55,14 @@ export function loadInputs(): SetupInputs {
const version = core.getInput("version"); const version = core.getInput("version");
const versionFile = getVersionFile(workingDirectory); const versionFile = getVersionFile(workingDirectory);
const pythonVersion = getPythonVersion(versionFile); const pythonVersion = getPythonVersion(versionFile);
const pythonArch = core.getInput("python-arch");
const activateEnvironment = core.getBooleanInput("activate-environment"); const activateEnvironment = core.getBooleanInput("activate-environment");
const noProject = core.getBooleanInput("no-project"); const noProject = core.getBooleanInput("no-project");
const venvPath = getVenvPath(workingDirectory, activateEnvironment); const venvPath = getVenvPath(workingDirectory, activateEnvironment);
const checksum = core.getInput("checksum"); const checksum = core.getInput("checksum");
const enableCache = getEnableCache(); const enableCache = getEnableCache();
const restoreCache = core.getInput("restore-cache") === "true"; const restoreCache = core.getInput("restore-cache") === "true";
const saveCache = core.getInput("save-cache") === "true"; const saveCache = getSaveCache();
const cacheSuffix = core.getInput("cache-suffix") || ""; const cacheSuffix = core.getInput("cache-suffix") || "";
const cacheLocalPath = getCacheLocalPath( const cacheLocalPath = getCacheLocalPath(
workingDirectory, workingDirectory,
@@ -100,6 +102,7 @@ export function loadInputs(): SetupInputs {
manifestFile, manifestFile,
noProject, noProject,
pruneCache, pruneCache,
pythonArch,
pythonDir, pythonDir,
pythonVersion, pythonVersion,
quiet, quiet,
@@ -146,6 +149,10 @@ function getPythonVersion(versionFile: string): string {
} }
} }
export function resolvePythonArch(pythonArch: string): string {
return pythonArch || process.env.UV_PYTHON_ARCH || "";
}
function getVenvPath( function getVenvPath(
workingDirectory: string, workingDirectory: string,
activateEnvironment: boolean, activateEnvironment: boolean,
@@ -189,6 +196,18 @@ function getEnableCache(): boolean {
return enableCacheInput === "true"; return enableCacheInput === "true";
} }
function getSaveCache(): boolean {
const saveCacheInput = core.getInput("save-cache");
if (saveCacheInput === "auto") {
if (process.env.GITHUB_EVENT_NAME === "merge_group") {
log.info("Cache saving is disabled for the merge_group event");
return false;
}
return true;
}
return saveCacheInput === "true";
}
function getToolBinDir(workingDirectory: string): string | undefined { function getToolBinDir(workingDirectory: string): string | undefined {
const toolBinDirInput = core.getInput("tool-bin-dir"); const toolBinDirInput = core.getInput("tool-bin-dir");
if (toolBinDirInput !== "") { if (toolBinDirInput !== "") {

76
src/utils/python-arch.ts Normal file
View File

@@ -0,0 +1,76 @@
import { execFile } from "node:child_process";
import { promisify } from "node:util";
import * as core from "@actions/core";
import { resolvePythonArch } from "./inputs";
import * as log from "./logging";
const execFileAsync = promisify(execFile);
const PROBE_ARCH = "setup-uv-probe";
export async function setupPythonArch(
uvPath: string,
pythonArchInput: string,
): Promise<void> {
const pythonArch = resolvePythonArch(pythonArchInput);
if (pythonArch === "") {
return;
}
// Older uv releases ignore unknown environment variables. An invalid architecture
// confirms that uv recognizes UV_PYTHON_ARCH without finding or downloading Python.
const probe = await queryPythonArch(uvPath, PROBE_ARCH);
if (probe.exitCode === 0) {
throw new Error(
"The installed version of uv does not support UV_PYTHON_ARCH. Select a newer uv version or use an architecture-qualified python-version.",
);
}
if (
!probe.stderr.includes(
`environment variable \`UV_PYTHON_ARCH\` with invalid value \`${PROBE_ARCH}\``,
)
) {
throw new Error(
`Failed to check uv's support for UV_PYTHON_ARCH: ${probe.stderr.trim() || `uv exited with code ${probe.exitCode}`}`,
);
}
const selected = await queryPythonArch(uvPath, pythonArch);
if (selected.exitCode !== 0) {
throw new Error(
`Failed to set Python architecture to ${pythonArch}: ${selected.stderr.trim() || `uv exited with code ${selected.exitCode}`}`,
);
}
if (pythonArchInput !== "") {
core.exportVariable("UV_PYTHON_ARCH", pythonArch);
log.info(`Set UV_PYTHON_ARCH to ${pythonArch}`);
}
}
async function queryPythonArch(
uvPath: string,
pythonArch: string,
): Promise<{ exitCode: number; stderr: string }> {
try {
const { stderr } = await execFileAsync(
uvPath,
["--no-config", "cache", "dir"],
{
encoding: "utf8",
env: { ...process.env, NO_COLOR: "1", UV_PYTHON_ARCH: pythonArch },
},
);
return { exitCode: 0, stderr };
} catch (error) {
if (
error instanceof Error &&
"code" in error &&
typeof error.code === "number" &&
"stderr" in error &&
typeof error.stderr === "string"
) {
return { exitCode: error.code, stderr: error.stderr };
}
throw error;
}
}