Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve find-python to add "Scripts" folder to PATH on Windows machines (releases/v1 branch) #173

Merged
merged 1 commit into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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