1
0
Fork 0
mirror of https://github.com/actions/setup-python.git synced 2025-04-08 09:08:37 +00: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

25
dist/setup/index.js vendored
View file

@ -99613,17 +99613,28 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
(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
const userScriptsDir = path.join(process.env['APPDATA'] || '', 'Python', `Python${major}${minor}-${arch}`, 'Scripts');
core.addPath(userScriptsDir);
const pythonPath = path.join(process.env['APPDATA'] || '', 'Python', `Python${major}${minor}-${arch}`, 'Scripts');
core.addPath(pythonPath);
}
else {
// For Python >= 3.10 and architecture 'x64', or other versions, use the default user path
const userScriptsDir = path.join(process.env['APPDATA'] || '', 'Python', `Python${major}${minor}`, 'Scripts');
core.addPath(userScriptsDir);
const pythonPath = path.join(process.env['APPDATA'] || '', 'Python', `Python${major}${minor}`, '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);
}
// 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.
}

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.
}