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