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

feature: add a python-path output

Expose a `python-path` output containing the chosen Python executable path.
This commit is contained in:
mayeut 2022-05-23 20:59:37 +02:00
parent fff15a21cc
commit ff706563d7
No known key found for this signature in database
GPG key ID: 8B03CED67D3ABFBA
9 changed files with 84 additions and 4 deletions

View file

@ -83,8 +83,14 @@ export async function useCpythonVersion(
}
}
const _binDir = binDir(installDir);
const binaryExtension = IS_WINDOWS ? '.exe' : '';
const pythonPath = path.join(
IS_WINDOWS ? installDir : _binDir,
`python${binaryExtension}`
);
core.addPath(installDir);
core.addPath(binDir(installDir));
core.addPath(_binDir);
if (IS_WINDOWS) {
// Add --user directory
@ -106,6 +112,7 @@ export async function useCpythonVersion(
const installed = versionFromPath(installDir);
core.setOutput('python-version', installed);
core.setOutput('python-path', pythonPath);
return {impl: 'CPython', version: installed};
}