Try to force pip to install itself on PATH

This commit is contained in:
Joe Rickerby
2021-05-08 18:11:27 +01:00
parent 62672c8101
commit add1a64a53
+10 -3
View File
@@ -173,9 +173,18 @@ def setup_python(
)
sys.exit(1)
# make sure pip is installed
log.step("Installing build tools...")
# make sure pip is installed and available on PATH
if not (installation_path / "Scripts" / "pip.exe").exists():
# perhaps pip is installed, but not available as 'pip.exe'...
if (installation_path / "Scripts" / "pip3.exe").exists():
# if it's there, remove that version of pip.
call(["python", "-m", "pip", "uninstall", "pip"])
# Then reinstall. '--default-pip' ensures that it's installed as 'pip.exe'
call(["python", "-m", "ensurepip", "--default-pip"], env=env, cwd="C:\\cibw")
assert (installation_path / "Scripts" / "pip.exe").exists()
where_pip = (
subprocess.run(
@@ -191,8 +200,6 @@ def setup_python(
)
sys.exit(1)
log.step("Installing build tools...")
call(
["python", "-m", "pip", "install", "--upgrade", "pip", *dependency_constraint_flags],
env=env,