From 152ba7c4dd6521b8e9c93f72d362ce03bf6c4f20 Mon Sep 17 00:00:00 2001 From: Nikita Bykov <49442273+nikita-bykov@users.noreply.github.com> Date: Fri, 18 Dec 2020 17:32:23 +0300 Subject: [PATCH] added Scripts to PATH on Windows (#173) Co-authored-by: Nikita Bykov --- dist/index.js | 5 +++++ src/find-python.ts | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/dist/index.js b/dist/index.js index 4a0302d..f866658 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6437,6 +6437,10 @@ function usePyPy(majorVersion, architecture) { core.exportVariable('pythonLocation', pythonLocation); core.addPath(installDir); core.addPath(_binDir); + // Starting from PyPy 7.3.1, the folder that is used for pip and anything that pip installs should be "Scripts" on Windows. + if (IS_WINDOWS) { + core.addPath(path.join(installDir, 'Scripts')); + } const impl = 'pypy' + majorVersion.toString(); core.setOutput('python-version', impl); return { impl: impl, version: versionFromPath(installDir) }; @@ -6515,6 +6519,7 @@ function findPythonVersion(version, architecture) { case 'PYPY2': return usePyPy('2', architecture); case 'PYPY3': + // keep pypy3 pointing to 3.6 for backward compatibility return usePyPy('3.6', architecture); default: return yield useCpythonVersion(version, architecture); diff --git a/src/find-python.ts b/src/find-python.ts index e11dd4d..6ce947f 100644 --- a/src/find-python.ts +++ b/src/find-python.ts @@ -80,6 +80,10 @@ function usePyPy( core.addPath(installDir); core.addPath(_binDir); + // Starting from PyPy 7.3.1, the folder that is used for pip and anything that pip installs should be "Scripts" on Windows. + if (IS_WINDOWS) { + core.addPath(path.join(installDir, 'Scripts')); + } const impl = 'pypy' + majorVersion.toString(); core.setOutput('python-version', impl);