mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-10-25 00:37:44 +00:00
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:
1 parent
c84232ca4f
commit
b06acff4b6
15 files changed
+431
-15
No files matched your search
@@ -24,6 +24,8 @@ export interface SetupInputs {
|
||||
version: string;
|
||||
versionFile: string;
|
||||
pythonVersion: string;
|
||||
pythonArch: string;
|
||||
exportPythonArch: boolean;
|
||||
activateEnvironment: boolean;
|
||||
noProject: boolean;
|
||||
venvPath: string;
|
||||
@@ -54,6 +56,9 @@ export function loadInputs(): SetupInputs {
|
||||
const version = core.getInput("version");
|
||||
const versionFile = getVersionFile(workingDirectory);
|
||||
const pythonVersion = getPythonVersion(versionFile);
|
||||
const pythonArchInput = core.getInput("python-arch");
|
||||
const pythonArch = pythonArchInput || process.env.UV_PYTHON_ARCH || "";
|
||||
const exportPythonArch = pythonArchInput !== "";
|
||||
const activateEnvironment = core.getBooleanInput("activate-environment");
|
||||
const noProject = core.getBooleanInput("no-project");
|
||||
const venvPath = getVenvPath(workingDirectory, activateEnvironment);
|
||||
@@ -94,12 +99,14 @@ export function loadInputs(): SetupInputs {
|
||||
checksum,
|
||||
downloadFromAstralMirror,
|
||||
enableCache,
|
||||
exportPythonArch,
|
||||
githubToken,
|
||||
ignoreEmptyWorkdir,
|
||||
ignoreNothingToCache,
|
||||
manifestFile,
|
||||
noProject,
|
||||
pruneCache,
|
||||
pythonArch,
|
||||
pythonDir,
|
||||
pythonVersion,
|
||||
quiet,
|
||||
|
||||
Reference in new issue
Block a user