mirror of
https://github.com/actions/setup-python.git
synced 2026-11-16 14:05:04 +08:00
Merge e201669395 into ec52d0af72
This commit is contained in:
commit
e881f89801
3 changed files with 13 additions and 5 deletions
|
|
@ -380,7 +380,15 @@ describe('installPyPy', () => {
|
||||||
expect(spyDownloadTool).toHaveBeenCalled();
|
expect(spyDownloadTool).toHaveBeenCalled();
|
||||||
expect(spyExistsSync).toHaveBeenCalled();
|
expect(spyExistsSync).toHaveBeenCalled();
|
||||||
expect(spyCacheDir).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 () => {
|
it('found and install PyPy, pre-release fallback', async () => {
|
||||||
|
|
|
||||||
3
dist/setup/index.js
vendored
3
dist/setup/index.js
vendored
|
|
@ -99820,7 +99820,8 @@ async function install_pypy_installPip(pythonLocation) {
|
||||||
info('Installing and updating pip');
|
info('Installing and updating pip');
|
||||||
const pythonBinary = external_path_.join(pythonLocation, 'python');
|
const pythonBinary = external_path_.join(pythonLocation, 'python');
|
||||||
await exec_exec(`${pythonBinary} -m ensurepip`);
|
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) {
|
function findRelease(releases, pythonVersion, pypyVersion, architecture, includePrerelease) {
|
||||||
const options = { includePrerelease: includePrerelease };
|
const options = { includePrerelease: includePrerelease };
|
||||||
|
|
|
||||||
|
|
@ -177,9 +177,8 @@ async function installPip(pythonLocation: string) {
|
||||||
const pythonBinary = path.join(pythonLocation, 'python');
|
const pythonBinary = path.join(pythonLocation, 'python');
|
||||||
await exec.exec(`${pythonBinary} -m ensurepip`);
|
await exec.exec(`${pythonBinary} -m ensurepip`);
|
||||||
|
|
||||||
await exec.exec(
|
// Do not use --ignore-installed; pip must remove files from previous versions.
|
||||||
`${pythonLocation}/python -m pip install --ignore-installed pip`
|
await exec.exec(`${pythonLocation}/python -m pip install --upgrade pip`);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function findRelease(
|
export function findRelease(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue