Try adding the existence check before reinstalling
This commit is contained in:
@@ -232,8 +232,8 @@ def setup_python(
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# ensure pip is installed
|
# ensure pip is installed
|
||||||
|
if not (installation_bin_path / "pip").exists():
|
||||||
call(["python", "-m", "ensurepip"], env=env, cwd="/tmp")
|
call(["python", "-m", "ensurepip"], env=env, cwd="/tmp")
|
||||||
# ensure we have the version that matches our constraints
|
|
||||||
# use "--force-reinstall" ensures that it's installed as 'pip'
|
# use "--force-reinstall" ensures that it's installed as 'pip'
|
||||||
call(
|
call(
|
||||||
[
|
[
|
||||||
@@ -248,6 +248,14 @@ def setup_python(
|
|||||||
env=env,
|
env=env,
|
||||||
cwd="/tmp",
|
cwd="/tmp",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# ensure we have the version that matches our constraints
|
||||||
|
call(
|
||||||
|
["python", "-m", "pip", "install", "--upgrade", "pip", *dependency_constraint_flags],
|
||||||
|
env=env,
|
||||||
|
cwd="/tmp",
|
||||||
|
)
|
||||||
|
|
||||||
assert (installation_bin_path / "pip").exists()
|
assert (installation_bin_path / "pip").exists()
|
||||||
call(["which", "pip"], env=env)
|
call(["which", "pip"], env=env)
|
||||||
call(["pip", "--version"], env=env)
|
call(["pip", "--version"], env=env)
|
||||||
|
|||||||
@@ -176,8 +176,8 @@ def setup_python(
|
|||||||
log.step("Installing build tools...")
|
log.step("Installing build tools...")
|
||||||
|
|
||||||
# ensure pip is installed
|
# ensure pip is installed
|
||||||
|
if not (installation_path / "Scripts" / "pip.exe").exists():
|
||||||
call(["python", "-m", "ensurepip"], env=env, cwd="C:\\cibw")
|
call(["python", "-m", "ensurepip"], env=env, cwd="C:\\cibw")
|
||||||
# ensure we have the version that matches our constraints
|
|
||||||
# use "--force-reinstall" ensures that it's installed as 'pip.exe'
|
# use "--force-reinstall" ensures that it's installed as 'pip.exe'
|
||||||
call(
|
call(
|
||||||
[
|
[
|
||||||
@@ -192,6 +192,12 @@ def setup_python(
|
|||||||
env=env,
|
env=env,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# ensure we have the version that matches our constraints
|
||||||
|
call(
|
||||||
|
["python", "-m", "pip", "install", "--upgrade", "pip", *dependency_constraint_flags],
|
||||||
|
env=env,
|
||||||
|
)
|
||||||
|
|
||||||
assert (installation_path / "Scripts" / "pip.exe").exists()
|
assert (installation_path / "Scripts" / "pip.exe").exists()
|
||||||
where_pip = (
|
where_pip = (
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
|
|||||||
Reference in New Issue
Block a user