Use the same mechanism on mac for ensuring default-pip
This commit is contained in:
+16
-5
@@ -232,11 +232,22 @@ def setup_python(
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# ensure pip is installed
|
# ensure pip is installed
|
||||||
call(
|
if not (installation_bin_path / "pip").exists():
|
||||||
["python", "-m", "ensurepip", "--default-pip"],
|
# perhaps pip is installed, but not available as 'pip'...
|
||||||
env=env,
|
try:
|
||||||
cwd="/tmp",
|
call(["python", "-m", "pip", "--version"], env=env, cwd="/tmp")
|
||||||
)
|
except subprocess.CalledProcessError:
|
||||||
|
pip_is_installed = False
|
||||||
|
else:
|
||||||
|
pip_is_installed = True
|
||||||
|
|
||||||
|
if pip_is_installed:
|
||||||
|
# if it's there, remove that version of pip.
|
||||||
|
call(["python", "-m", "pip", "uninstall", "--yes", "pip"], env=env, cwd="C:\\cibw")
|
||||||
|
|
||||||
|
# Then reinstall. '--default-pip' ensures that it's installed as 'pip'
|
||||||
|
call(["python", "-m", "ensurepip", "--default-pip"], env=env, cwd="C:\\cibw")
|
||||||
|
|
||||||
# ensure we have the version that matches our constraints
|
# ensure we have the version that matches our constraints
|
||||||
call(
|
call(
|
||||||
["python", "-m", "pip", "install", "--upgrade", "pip", *dependency_constraint_flags],
|
["python", "-m", "pip", "install", "--upgrade", "pip", *dependency_constraint_flags],
|
||||||
|
|||||||
Reference in New Issue
Block a user