Skip to content

Commit

Permalink
added Scripts to PATH on Windows (#173)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikita Bykov <v-nibyko@microsoft.com>
  • Loading branch information
nikita-bykov and Nikita Bykov committed Dec 18, 2020
1 parent da8703f commit 152ba7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) };
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions src/find-python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 152ba7c

Please sign in to comment.