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:
parent
feb0ff9aba
commit
da4451310f
2 changed files with 48 additions and 19 deletions
25
dist/setup/index.js
vendored
25
dist/setup/index.js
vendored
|
@ -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.
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue