Only call ensurepip if bin/pip wasn't found
This commit is contained in:
@@ -231,12 +231,15 @@ def setup_python(
|
|||||||
)
|
)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# ensure pip is installed
|
# Install pip
|
||||||
|
|
||||||
|
requires_reinstall = not (installation_bin_path / "pip").exists()
|
||||||
|
if requires_reinstall:
|
||||||
|
# maybe pip isn't installed at all. ensurepip resolves that.
|
||||||
call(["python", "-m", "ensurepip"], env=env, cwd="/tmp")
|
call(["python", "-m", "ensurepip"], env=env, cwd="/tmp")
|
||||||
|
|
||||||
# upgrade to the version matching our constraints
|
# upgrade pip to the version matching our constraints
|
||||||
# if necessary, reinstall it to ensure that it's installed as 'pip'
|
# if necessary, reinstall it to ensure that it's available on PATH as 'pip'
|
||||||
requires_reinstall = not (installation_bin_path / "pip").exists()
|
|
||||||
call(
|
call(
|
||||||
[
|
[
|
||||||
"python",
|
"python",
|
||||||
|
|||||||
@@ -175,12 +175,15 @@ def setup_python(
|
|||||||
|
|
||||||
log.step("Installing build tools...")
|
log.step("Installing build tools...")
|
||||||
|
|
||||||
# ensure pip is installed
|
# Install pip
|
||||||
|
|
||||||
|
requires_reinstall = not (installation_path / "Scripts" / "pip.exe").exists()
|
||||||
|
if requires_reinstall:
|
||||||
|
# maybe pip isn't installed at all. ensurepip resolves that.
|
||||||
call(["python", "-m", "ensurepip"], env=env, cwd="C:\\cibw")
|
call(["python", "-m", "ensurepip"], env=env, cwd="C:\\cibw")
|
||||||
|
|
||||||
# upgrade to the version matching our constraints
|
# upgrade pip to the version matching our constraints
|
||||||
# if necessary, reinstall it to ensure that it's installed as 'pip.exe'
|
# if necessary, reinstall it to ensure that it's available on PATH as 'pip.exe'
|
||||||
requires_reinstall = not (installation_path / "Scripts" / "pip.exe").exists()
|
|
||||||
call(
|
call(
|
||||||
[
|
[
|
||||||
"python",
|
"python",
|
||||||
@@ -192,6 +195,7 @@ def setup_python(
|
|||||||
*dependency_constraint_flags,
|
*dependency_constraint_flags,
|
||||||
],
|
],
|
||||||
env=env,
|
env=env,
|
||||||
|
cwd="C:\\cibw",
|
||||||
)
|
)
|
||||||
|
|
||||||
assert (installation_path / "Scripts" / "pip.exe").exists()
|
assert (installation_path / "Scripts" / "pip.exe").exists()
|
||||||
|
|||||||
Reference in New Issue
Block a user