mirror of
https://code.forgejo.org/actions/setup-python.git
synced 2025-02-22 10:25:45 -05:00
update-install path --user flag for x86 for >=3.10
This commit is contained in:
parent
6ca8e8598f
commit
bd89e34f27
2 changed files with 37 additions and 9 deletions
14
dist/setup/index.js
vendored
14
dist/setup/index.js
vendored
|
@ -99611,8 +99611,18 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
|
|||
const version = path.basename(path.dirname(installDir));
|
||||
const major = semver.major(version);
|
||||
const minor = semver.minor(version);
|
||||
const userScriptsDir = path.join(process.env['APPDATA'] || '', 'Python', `Python${major}${minor}`, 'Scripts');
|
||||
core.addPath(userScriptsDir);
|
||||
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';
|
||||
const userScriptsDir = path.join(process.env['APPDATA'] || '', 'Python', `Python${major}${minor}-${arch}`, 'Scripts');
|
||||
core.addPath(userScriptsDir);
|
||||
}
|
||||
else {
|
||||
const userScriptsDir = path.join(process.env['APPDATA'] || '', 'Python', `Python${major}${minor}`, 'Scripts');
|
||||
// Add the default path to the environment PATH variable
|
||||
core.addPath(userScriptsDir);
|
||||
}
|
||||
}
|
||||
// On Linux and macOS, pip will create the --user directory and add it to PATH as needed.
|
||||
}
|
||||
|
|
|
@ -141,13 +141,31 @@ export async function useCpythonVersion(
|
|||
const major = semver.major(version);
|
||||
const minor = semver.minor(version);
|
||||
|
||||
const userScriptsDir = path.join(
|
||||
process.env['APPDATA'] || '',
|
||||
'Python',
|
||||
`Python${major}${minor}`,
|
||||
'Scripts'
|
||||
);
|
||||
core.addPath(userScriptsDir);
|
||||
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';
|
||||
|
||||
const userScriptsDir = path.join(
|
||||
process.env['APPDATA'] || '',
|
||||
'Python',
|
||||
`Python${major}${minor}-${arch}`,
|
||||
'Scripts'
|
||||
);
|
||||
core.addPath(userScriptsDir);
|
||||
} else {
|
||||
const userScriptsDir = path.join(
|
||||
process.env['APPDATA'] || '',
|
||||
'Python',
|
||||
`Python${major}${minor}`,
|
||||
'Scripts'
|
||||
);
|
||||
|
||||
// Add the default path to the environment PATH variable
|
||||
core.addPath(userScriptsDir);
|
||||
}
|
||||
}
|
||||
// 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