feature: add a python-path output · actions/setup-python@ff70656 (original) (raw)

`@@ -52375,12 +52375,15 @@ function findPyPyVersion(versionSpec, architecture) {

`

52375

52375

` }

`

52376

52376

` const pipDir = utils_1.IS_WINDOWS ? 'Scripts' : 'bin';

`

52377

52377

` const _binDir = path.join(installDir, pipDir);

`

``

52378

`+

const binaryExtension = utils_1.IS_WINDOWS ? '.exe' : '';

`

``

52379

`` +

const pythonPath = path.join(utils_1.IS_WINDOWS ? installDir : _binDir, python${binaryExtension});

``

52378

52380

` const pythonLocation = pypyInstall.getPyPyBinaryPath(installDir);

`

52379

52381

` core.exportVariable('pythonLocation', pythonLocation);

`

52380

52382

` core.exportVariable('PKG_CONFIG_PATH', pythonLocation + '/lib/pkgconfig');

`

52381

52383

` core.addPath(pythonLocation);

`

52382

52384

` core.addPath(_binDir);

`

52383

52385

` core.setOutput('python-version', 'pypy' + resolvedPyPyVersion.trim());

`

``

52386

`+

core.setOutput('python-path', pythonPath);

`

52384

52387

` return { resolvedPyPyVersion, resolvedPythonVersion };

`

52385

52388

` });

`

52386

52389

`}

`

`@@ -57027,8 +57030,11 @@ function useCpythonVersion(version, architecture) {

`

57027

57030

` core.exportVariable('LD_LIBRARY_PATH', pyLibPath + libPath);

`

57028

57031

` }

`

57029

57032

` }

`

``

57033

`+

const _binDir = binDir(installDir);

`

``

57034

`+

const binaryExtension = utils_1.IS_WINDOWS ? '.exe' : '';

`

``

57035

`` +

const pythonPath = path.join(utils_1.IS_WINDOWS ? installDir : _binDir, python${binaryExtension});

``

57030

57036

` core.addPath(installDir);

`

57031

``

`-

core.addPath(binDir(installDir));

`

``

57037

`+

core.addPath(_binDir);

`

57032

57038

` if (utils_1.IS_WINDOWS) {

`

57033

57039

` // Add --user directory

`

57034

57040

`` // installDir from tool cache should look like $RUNNER_TOOL_CACHE/Python//x64/

``

`@@ -57042,6 +57048,7 @@ function useCpythonVersion(version, architecture) {

`

57042

57048

` // On Linux and macOS, pip will create the --user directory and add it to PATH as needed.

`

57043

57049

` const installed = versionFromPath(installDir);

`

57044

57050

` core.setOutput('python-version', installed);

`

``

57051

`+

core.setOutput('python-path', pythonPath);

`

57045

57052

` return { impl: 'CPython', version: installed };

`

57046

57053

` });

`

57047

57054

`}

`