1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-03-14 22:26:58 +01:00

logic update

This commit is contained in:
Aparna Jyothi 2025-02-19 16:31:47 +05:30
parent c628d93a80
commit cb0e07d80e
2 changed files with 14 additions and 4 deletions

9
dist/setup/index.js vendored
View file

@ -99609,9 +99609,14 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
const version = path.basename(path.dirname(installDir));
const major = semver.major(version);
const minor = semver.minor(version);
if ((major > 3 || (major === 3 && minor >= 10)) && architecture !== 'x64') {
if (major > 3 || (major === 3 && minor >= 10)) {
// For Python >= 3.10 and architecture!= 'x64', add the architecture-specific folder to the path
const arch = architecture === '32';
let arch = '';
// Check for x32 or x86 and append the '-32' suffix
// Check for x32 or x86 and append the '-32' suffix
if (architecture === 'x32' || architecture === 'x86') {
arch = `32`; // Always add '-32' for both x32 and x86 architectures
}
const userScriptsDir = path.join(process.env['APPDATA'] || '', 'Python', `Python${major}${minor}-${arch}`, // Add architecture-specific folder (e.g., Python310-64 or Python310-32)
'Scripts');
// Add the dynamically constructed path to the environment PATH variable

View file

@ -139,9 +139,14 @@ export async function useCpythonVersion(
const major = semver.major(version);
const minor = semver.minor(version);
if ((major > 3 || (major === 3 && minor >= 10)) && architecture !== 'x64') {
if (major > 3 || (major === 3 && minor >= 10)) {
// For Python >= 3.10 and architecture!= 'x64', add the architecture-specific folder to the path
const arch = architecture === '32';
let arch = '';
// Check for x32 or x86 and append the '-32' suffix
// Check for x32 or x86 and append the '-32' suffix
if (architecture === 'x32' || architecture === 'x86') {
arch = `32`; // Always add '-32' for both x32 and x86 architectures
}
const userScriptsDir = path.join(
process.env['APPDATA'] || '',