mirror of
https://code.forgejo.org/actions/setup-python
synced 2025-06-08 12:28:20 +02:00
Added architecture validation validated for freethreaded related inputs
This commit is contained in:
parent
9d11fda211
commit
b26f6d02db
2 changed files with 8 additions and 6 deletions
5
dist/setup/index.js
vendored
5
dist/setup/index.js
vendored
|
@ -96817,6 +96817,9 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
|
||||||
// Use the freethreaded version if it was specified in the input, e.g., 3.13t
|
// Use the freethreaded version if it was specified in the input, e.g., 3.13t
|
||||||
freethreaded = true;
|
freethreaded = true;
|
||||||
}
|
}
|
||||||
|
if (architecture.endsWith('-freethreaded')) {
|
||||||
|
throw new Error(`Invalid architecture '${architecture}'. Use 'freethreaded' flag in the python-version (e.g., '3.13.1t') or - freethreaded: true instead of specifying '-freethreaded' in the architecture`);
|
||||||
|
}
|
||||||
core.debug(`Semantic version spec of ${version} is ${semanticVersionSpec}`);
|
core.debug(`Semantic version spec of ${version} is ${semanticVersionSpec}`);
|
||||||
if (freethreaded) {
|
if (freethreaded) {
|
||||||
// Free threaded versions use an architecture suffix like `x64-freethreaded`
|
// Free threaded versions use an architecture suffix like `x64-freethreaded`
|
||||||
|
@ -96887,8 +96890,6 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
|
||||||
const version = path.basename(path.dirname(installDir));
|
const version = path.basename(path.dirname(installDir));
|
||||||
const major = semver.major(version);
|
const major = semver.major(version);
|
||||||
const minor = semver.minor(version);
|
const minor = semver.minor(version);
|
||||||
const freethreadedInput = core.getInput('freethreaded');
|
|
||||||
const freethreaded = freethreadedInput === 'true' || architecture.includes('freethreaded');
|
|
||||||
const basePath = process.env['APPDATA'] || '';
|
const basePath = process.env['APPDATA'] || '';
|
||||||
let versionSuffix = `${major}${minor}`;
|
let versionSuffix = `${major}${minor}`;
|
||||||
// Append '-32' for x86 architecture if Python version is >= 3.10
|
// Append '-32' for x86 architecture if Python version is >= 3.10
|
||||||
|
|
|
@ -49,8 +49,12 @@ export async function useCpythonVersion(
|
||||||
// Use the freethreaded version if it was specified in the input, e.g., 3.13t
|
// Use the freethreaded version if it was specified in the input, e.g., 3.13t
|
||||||
freethreaded = true;
|
freethreaded = true;
|
||||||
}
|
}
|
||||||
|
if (architecture.endsWith('-freethreaded')) {
|
||||||
|
throw new Error(
|
||||||
|
`Invalid architecture '${architecture}'. Use 'freethreaded' flag in the python-version (e.g., '3.13.1t') or - freethreaded: true instead of specifying '-freethreaded' in the architecture`
|
||||||
|
);
|
||||||
|
}
|
||||||
core.debug(`Semantic version spec of ${version} is ${semanticVersionSpec}`);
|
core.debug(`Semantic version spec of ${version} is ${semanticVersionSpec}`);
|
||||||
|
|
||||||
if (freethreaded) {
|
if (freethreaded) {
|
||||||
// Free threaded versions use an architecture suffix like `x64-freethreaded`
|
// Free threaded versions use an architecture suffix like `x64-freethreaded`
|
||||||
core.debug(`Using freethreaded version of ${semanticVersionSpec}`);
|
core.debug(`Using freethreaded version of ${semanticVersionSpec}`);
|
||||||
|
@ -156,9 +160,6 @@ export async function useCpythonVersion(
|
||||||
const version = path.basename(path.dirname(installDir));
|
const version = path.basename(path.dirname(installDir));
|
||||||
const major = semver.major(version);
|
const major = semver.major(version);
|
||||||
const minor = semver.minor(version);
|
const minor = semver.minor(version);
|
||||||
const freethreadedInput = core.getInput('freethreaded');
|
|
||||||
const freethreaded =
|
|
||||||
freethreadedInput === 'true' || architecture.includes('freethreaded');
|
|
||||||
|
|
||||||
const basePath = process.env['APPDATA'] || '';
|
const basePath = process.env['APPDATA'] || '';
|
||||||
let versionSuffix = `${major}${minor}`;
|
let versionSuffix = `${major}${minor}`;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue