1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-08 12:28:20 +02:00

resolve conflicts

This commit is contained in:
Aparna Jyothi 2025-04-28 19:05:57 +05:30
parent 114b4684b8
commit c614f62548
3 changed files with 7 additions and 4 deletions

View file

@ -100,6 +100,7 @@ jobs:
os: os:
[ [
macos-latest, macos-latest,
windows-latest,
ubuntu-22.04, ubuntu-22.04,
ubuntu-22.04-arm, ubuntu-22.04-arm,
macos-13, macos-13,

5
dist/setup/index.js vendored
View file

@ -96884,6 +96884,8 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
core.addPath(_binDir); core.addPath(_binDir);
if (utils_1.IS_WINDOWS) { if (utils_1.IS_WINDOWS) {
// Add --user directory // Add --user directory
// `installDir` from tool cache should look like $RUNNER_TOOL_CACHE/Python/<semantic version>/x64/
// So if `findLocalTool` succeeded above, we must have a conformant `installDir`// Add --user directory
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);
@ -96895,11 +96897,10 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
core.addPath(userScriptsDir); core.addPath(userScriptsDir);
} }
else { 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'); const userScriptsDir = path.join(process.env['APPDATA'] || '', 'Python', `Python${major}${minor}`, 'Scripts');
core.addPath(userScriptsDir); core.addPath(userScriptsDir);
} }
// Dynamically handle case for Python314t // for free-freethreaded versions, add the freethreaded scripts directory
const pythonPath = path.join(process.env['APPDATA'] || '', 'Python', `Python${major}${minor}t`, 'Scripts'); const pythonPath = path.join(process.env['APPDATA'] || '', 'Python', `Python${major}${minor}t`, 'Scripts');
core.addPath(pythonPath); core.addPath(pythonPath);
} }

View file

@ -153,6 +153,8 @@ export async function useCpythonVersion(
if (IS_WINDOWS) { if (IS_WINDOWS) {
// Add --user directory // Add --user directory
// `installDir` from tool cache should look like $RUNNER_TOOL_CACHE/Python/<semantic version>/x64/
// So if `findLocalTool` succeeded above, we must have a conformant `installDir`// Add --user directory
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);
@ -172,7 +174,6 @@ export async function useCpythonVersion(
); );
core.addPath(userScriptsDir); core.addPath(userScriptsDir);
} else { } else {
// For Python >= 3.10 and architecture 'x64', or other versions, use the default user path
const userScriptsDir = path.join( const userScriptsDir = path.join(
process.env['APPDATA'] || '', process.env['APPDATA'] || '',
'Python', 'Python',
@ -182,7 +183,7 @@ export async function useCpythonVersion(
core.addPath(userScriptsDir); core.addPath(userScriptsDir);
} }
// Dynamically handle case for Python314t // for free-freethreaded versions, add the freethreaded scripts directory
const pythonPath = path.join( const pythonPath = path.join(
process.env['APPDATA'] || '', process.env['APPDATA'] || '',
'Python', 'Python',