1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-08 12:28:20 +02:00

update the logic to allow x86-freethreaded, arm64-freethreaded, x64-freethreaded inputs also

This commit is contained in:
Aparna Jyothi 2025-06-05 12:30:47 +05:30
parent 3d7ca5fea2
commit 9d11fda211
2 changed files with 11 additions and 0 deletions

5
dist/setup/index.js vendored
View file

@ -96887,6 +96887,8 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
const version = path.basename(path.dirname(installDir));
const major = semver.major(version);
const minor = semver.minor(version);
const freethreadedInput = core.getInput('freethreaded');
const freethreaded = freethreadedInput === 'true' || architecture.includes('freethreaded');
const basePath = process.env['APPDATA'] || '';
let versionSuffix = `${major}${minor}`;
// Append '-32' for x86 architecture if Python version is >= 3.10
@ -96906,6 +96908,9 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
else if (architecture === 'arm64-freethreaded') {
versionSuffix += '-arm64';
}
else if (architecture === 'x64-freethreaded') {
versionSuffix += '-64';
}
}
// Add user Scripts path
const userScriptsDir = path.join(basePath, 'Python', `Python${versionSuffix}`, 'Scripts');

View file

@ -156,6 +156,10 @@ export async function useCpythonVersion(
const version = path.basename(path.dirname(installDir));
const major = semver.major(version);
const minor = semver.minor(version);
const freethreadedInput = core.getInput('freethreaded');
const freethreaded =
freethreadedInput === 'true' || architecture.includes('freethreaded');
const basePath = process.env['APPDATA'] || '';
let versionSuffix = `${major}${minor}`;
// Append '-32' for x86 architecture if Python version is >= 3.10
@ -174,6 +178,8 @@ export async function useCpythonVersion(
versionSuffix += '-32';
} else if (architecture === 'arm64-freethreaded') {
versionSuffix += '-arm64';
} else if (architecture === 'x64-freethreaded') {
versionSuffix += '-64';
}
}
// Add user Scripts path