Add python-arch support (#1079)

Windows ARM64 jobs may need x64 Python independently of their Python
version pin. Add `python-arch` to export `UV_PYTHON_ARCH` for subsequent
steps and include the selected architecture in the uv and managed-Python
cache keys. The input takes precedence over an inherited environment
value, and unsupported uv versions fail before environment creation.

Requires a uv release with `UV_PYTHON_ARCH` support.
This commit is contained in:
Zanie Blue authored and GitHub committed 2026-10-07 09:03:18 +02:00
1 parent c84232ca4f
commit b06acff4b6
15 files changed
+431 -15

No files matched your search

+6
View File
@@ -16,6 +16,7 @@ import {
getPlatform,
type Platform,
} from "./utils/platforms";
import { setupPythonArch } from "./utils/python-arch";
import { getPythonRuntimeId } from "./utils/python-runtime";
import { resolveUvVersion } from "./version/resolve";
@@ -86,6 +87,11 @@ async function run(): Promise<void> {
throw new Error(`Unsupported architecture: ${process.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, inputs.exportPythonArch);
addToolBinToPath(inputs);
addUvToPathAndOutput(setupResult.uvDir);