Skip to content

Commit 152ba7c

Browse files
nikita-bykovNikita Bykov
and
Nikita Bykov
authored
added Scripts to PATH on Windows (actions#173)
Co-authored-by: Nikita Bykov <v-nibyko@microsoft.com>
1 parent da8703f commit 152ba7c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

dist/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -6437,6 +6437,10 @@ function usePyPy(majorVersion, architecture) {
64376437
core.exportVariable('pythonLocation', pythonLocation);
64386438
core.addPath(installDir);
64396439
core.addPath(_binDir);
6440+
// Starting from PyPy 7.3.1, the folder that is used for pip and anything that pip installs should be "Scripts" on Windows.
6441+
if (IS_WINDOWS) {
6442+
core.addPath(path.join(installDir, 'Scripts'));
6443+
}
64406444
const impl = 'pypy' + majorVersion.toString();
64416445
core.setOutput('python-version', impl);
64426446
return { impl: impl, version: versionFromPath(installDir) };
@@ -6515,6 +6519,7 @@ function findPythonVersion(version, architecture) {
65156519
case 'PYPY2':
65166520
return usePyPy('2', architecture);
65176521
case 'PYPY3':
6522+
// keep pypy3 pointing to 3.6 for backward compatibility
65186523
return usePyPy('3.6', architecture);
65196524
default:
65206525
return yield useCpythonVersion(version, architecture);

src/find-python.ts

+4
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ function usePyPy(
8080

8181
core.addPath(installDir);
8282
core.addPath(_binDir);
83+
// Starting from PyPy 7.3.1, the folder that is used for pip and anything that pip installs should be "Scripts" on Windows.
84+
if (IS_WINDOWS) {
85+
core.addPath(path.join(installDir, 'Scripts'));
86+
}
8387

8488
const impl = 'pypy' + majorVersion.toString();
8589
core.setOutput('python-version', impl);

0 commit comments

Comments
 (0)