From 1ec1b0d2bd0e9943cc3a4b6a4e7e82a14fd341c6 Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Wed, 5 Feb 2025 21:06:09 +0000 Subject: [PATCH] Add 't' suffix to python-version output --- dist/setup/index.js | 7 ++++++- src/find-python.ts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index d3bf3ead..b06b72ea 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -91118,7 +91118,12 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest // On Linux and macOS, pip will create the --user directory and add it to PATH as needed. } const installed = versionFromPath(installDir); - core.setOutput('python-version', installed); + let pythonVersion = installed; + if (freethreaded) { + // Add the freethreaded suffix to the version (e.g., 3.13.1t) + pythonVersion += 't'; + } + core.setOutput('python-version', pythonVersion); core.setOutput('python-path', pythonPath); return { impl: 'CPython', version: installed }; }); diff --git a/src/find-python.ts b/src/find-python.ts index 606c4802..1cf47fa4 100644 --- a/src/find-python.ts +++ b/src/find-python.ts @@ -165,7 +165,12 @@ export async function useCpythonVersion( } const installed = versionFromPath(installDir); - core.setOutput('python-version', installed); + let pythonVersion = installed; + if (freethreaded) { + // Add the freethreaded suffix to the version (e.g., 3.13.1t) + pythonVersion += 't'; + } + core.setOutput('python-version', pythonVersion); core.setOutput('python-path', pythonPath); return {impl: 'CPython', version: installed};