diff --git a/.github/workflows/test-python-freethreaded.yml b/.github/workflows/test-python-freethreaded.yml index fc55e341..39e69a47 100644 --- a/.github/workflows/test-python-freethreaded.yml +++ b/.github/workflows/test-python-freethreaded.yml @@ -100,6 +100,7 @@ jobs: os: [ macos-latest, + windows-latest, ubuntu-22.04, ubuntu-22.04-arm, macos-13, diff --git a/dist/setup/index.js b/dist/setup/index.js index 73dd0c6d..72e00b8d 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -96884,6 +96884,8 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest core.addPath(_binDir); if (utils_1.IS_WINDOWS) { // Add --user directory + // `installDir` from tool cache should look like $RUNNER_TOOL_CACHE/Python//x64/ + // So if `findLocalTool` succeeded above, we must have a conformant `installDir`// Add --user directory const version = path.basename(path.dirname(installDir)); const major = semver.major(version); const minor = semver.minor(version); @@ -96895,11 +96897,10 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest core.addPath(userScriptsDir); } 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); } - // 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'); core.addPath(pythonPath); } diff --git a/src/find-python.ts b/src/find-python.ts index 188bc4c7..3a21f5c0 100644 --- a/src/find-python.ts +++ b/src/find-python.ts @@ -153,6 +153,8 @@ export async function useCpythonVersion( if (IS_WINDOWS) { // Add --user directory + // `installDir` from tool cache should look like $RUNNER_TOOL_CACHE/Python//x64/ + // So if `findLocalTool` succeeded above, we must have a conformant `installDir`// Add --user directory const version = path.basename(path.dirname(installDir)); const major = semver.major(version); const minor = semver.minor(version); @@ -172,7 +174,6 @@ export async function useCpythonVersion( ); core.addPath(userScriptsDir); } else { - // For Python >= 3.10 and architecture 'x64', or other versions, use the default user path const userScriptsDir = path.join( process.env['APPDATA'] || '', 'Python', @@ -182,7 +183,7 @@ export async function useCpythonVersion( 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',