mirror of
https://github.com/actions/setup-python.git
synced 2025-02-22 14:50:30 +07:00
update-install path --user flag for x86 for >=3.10
This commit is contained in:
parent
6ca8e8598f
commit
bd89e34f27
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 version = path.basename(path.dirname(installDir));
|
||||||
const major = semver.major(version);
|
const major = semver.major(version);
|
||||||
const minor = semver.minor(version);
|
const minor = semver.minor(version);
|
||||||
const userScriptsDir = path.join(process.env['APPDATA'] || '', 'Python', `Python${major}${minor}`, 'Scripts');
|
if (architecture === 'x86' &&
|
||||||
core.addPath(userScriptsDir);
|
(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.
|
// 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 major = semver.major(version);
|
||||||
const minor = semver.minor(version);
|
const minor = semver.minor(version);
|
||||||
|
|
||||||
const userScriptsDir = path.join(
|
if (
|
||||||
process.env['APPDATA'] || '',
|
architecture === 'x86' &&
|
||||||
'Python',
|
(major > 3 || (major === 3 && minor >= 10))
|
||||||
`Python${major}${minor}`,
|
) {
|
||||||
'Scripts'
|
// For Python >= 3.10 and architecture= 'x86', add the architecture-specific folder to the path
|
||||||
);
|
const arch = '32';
|
||||||
core.addPath(userScriptsDir);
|
|
||||||
|
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.
|
// On Linux and macOS, pip will create the --user directory and add it to PATH as needed.
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user