From 2831efe49a72a829fb30b0b3e668563482fd8b9a Mon Sep 17 00:00:00 2001 From: Nikita Bykov <49442273+nikita-bykov@users.noreply.github.com> Date: Thu, 17 Dec 2020 18:02:13 +0300 Subject: [PATCH] Improve find-python to add "Scripts" folder to PATH on Windows machines (#169) * added 'Scripts' folder to PATH on Windows * add release code * update index.js * rebuild index.js * remove duplicate block Co-authored-by: Nikita Bykov Co-authored-by: Dmitry Shibanov --- dist/index.js | 4 ++++ src/find-python.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/dist/index.js b/dist/index.js index 41cfa78..5362e84 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6738,6 +6738,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) }; diff --git a/src/find-python.ts b/src/find-python.ts index 6702430..6cc21d4 100644 --- a/src/find-python.ts +++ b/src/find-python.ts @@ -66,6 +66,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);