1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-16 16:04:11 +02:00

update the install path for free-threaded

This commit is contained in:
Aparna Jyothi 2025-03-25 11:05:31 +05:30
parent feb0ff9aba
commit da4451310f
2 changed files with 48 additions and 19 deletions

View file

@ -146,32 +146,50 @@ export async function useCpythonVersion(
// For Python >= 3.10 and architecture='x86', add the architecture-specific folder to the path
const arch = '32'; // Only for x86 architecture
const userScriptsDir = path.join(
const pythonPath = path.join(
process.env['APPDATA'] || '',
'Python',
`Python${major}${minor}-${arch}`,
'Scripts'
);
core.addPath(userScriptsDir);
core.addPath(pythonPath);
} else {
// For Python >= 3.10 and architecture 'x64', or other versions, use the default user path
const userScriptsDir = path.join(
const pythonPath = path.join(
process.env['APPDATA'] || '',
'Python',
`Python${major}${minor}`,
'Scripts'
);
core.addPath(userScriptsDir);
core.addPath(pythonPath);
}
// Dynamically handle case for Python314t
const pythonPath = path.join(
process.env['APPDATA'] || '',
'Python',
`Python${major}${minor}t`,
'Scripts'
);
core.addPath(pythonPath);
if (
architecture === 'x86' &&
(major > 3 || (major === 3 && minor >= 10))
) {
// For Python >= 3.10 and architecture='x86', add the architecture-specific folder to the path
const arch = '32'; // Only for x86 architecture
// Dynamically handle case for Python314t
const pythonPath = path.join(
process.env['APPDATA'] || '',
'Python',
`Python${major}${minor}t--${arch}`,
'Scripts'
);
core.addPath(pythonPath);
} else {
// For Python >= 3.10 and architecture 'x64', or other versions, use the default user path
// Dynamically handle case for Python314t
const pythonPath = path.join(
process.env['APPDATA'] || '',
'Python',
`Python${major}${minor}t`,
'Scripts'
);
core.addPath(pythonPath);
}
}
// On Linux and macOS, pip will create the --user directory and add it to PATH as needed.
}