Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion __tests__/install-pypy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,15 @@ describe('installPyPy', () => {
expect(spyDownloadTool).toHaveBeenCalled();
expect(spyExistsSync).toHaveBeenCalled();
expect(spyCacheDir).toHaveBeenCalled();
expect(spyExec).toHaveBeenCalled();
expect(spyExec).toHaveBeenCalledTimes(2);
expect(spyExec).toHaveBeenNthCalledWith(
1,
expect.stringMatching(/ -m ensurepip$/)
);
expect(spyExec).toHaveBeenNthCalledWith(
2,
expect.stringMatching(/ -m pip install --upgrade pip$/)
);
});

it('found and install PyPy, pre-release fallback', async () => {
Expand Down
3 changes: 2 additions & 1 deletion dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99820,7 +99820,8 @@ async function install_pypy_installPip(pythonLocation) {
info('Installing and updating pip');
const pythonBinary = external_path_.join(pythonLocation, 'python');
await exec_exec(`${pythonBinary} -m ensurepip`);
await exec_exec(`${pythonLocation}/python -m pip install --ignore-installed pip`);
// Do not use --ignore-installed; pip must remove files from previous versions.
await exec_exec(`${pythonLocation}/python -m pip install --upgrade pip`);
}
function findRelease(releases, pythonVersion, pypyVersion, architecture, includePrerelease) {
const options = { includePrerelease: includePrerelease };
Expand Down
5 changes: 2 additions & 3 deletions src/install-pypy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,8 @@ async function installPip(pythonLocation: string) {
const pythonBinary = path.join(pythonLocation, 'python');
await exec.exec(`${pythonBinary} -m ensurepip`);

await exec.exec(
`${pythonLocation}/python -m pip install --ignore-installed pip`
);
// Do not use --ignore-installed; pip must remove files from previous versions.
await exec.exec(`${pythonLocation}/python -m pip install --upgrade pip`);
}

export function findRelease(
Expand Down