chore: un-pin virtualenv update (#1830)

This commit is contained in:
Matthieu Darbois
2024-05-20 02:21:42 -04:00
committed by GitHub
parent 78bca57cb4
commit d1a4c9c074
6 changed files with 26 additions and 19 deletions
+3 -1
View File
@@ -181,7 +181,9 @@ def setup_python(
log.step("Setting up build environment...")
venv_path = tmp / "venv"
env = virtualenv(base_python, venv_path, dependency_constraint_flags)
env = virtualenv(
python_configuration.version, base_python, venv_path, dependency_constraint_flags
)
venv_bin_path = venv_path / "bin"
assert venv_bin_path.exists()
# Fix issue with site.py setting the wrong `sys.prefix`, `sys.exec_prefix`,
+2 -2
View File
@@ -1,2 +1,2 @@
version = "20.21.1"
url = "https://github.com/pypa/get-virtualenv/blob/20.21.1/public/virtualenv.pyz?raw=true"
py36 = { version = "20.21.1", url = "https://github.com/pypa/get-virtualenv/blob/20.21.1/public/virtualenv.pyz?raw=true" }
default = { version = "20.26.2", url = "https://github.com/pypa/get-virtualenv/blob/20.26.2/public/virtualenv.pyz?raw=true" }
+8 -5
View File
@@ -526,12 +526,15 @@ def get_pip_version(env: Mapping[str, str]) -> str:
@lru_cache(maxsize=None)
def _ensure_virtualenv() -> Path:
def _ensure_virtualenv(version: str) -> Path:
version_parts = version.split(".")
key = f"py{version_parts[0]}{version_parts[1]}"
input_file = resources_dir / "virtualenv.toml"
with input_file.open("rb") as f:
loaded_file = tomllib.load(f)
version = str(loaded_file["version"])
url = str(loaded_file["url"])
configuration = loaded_file.get(key, loaded_file["default"])
version = str(configuration["version"])
url = str(configuration["url"])
path = CIBW_CACHE_PATH / f"virtualenv-{version}.pyz"
with FileLock(str(path) + ".lock"):
if not path.exists():
@@ -587,10 +590,10 @@ def _parse_constraints_for_virtualenv(
def virtualenv(
python: Path, venv_path: Path, dependency_constraint_flags: Sequence[PathOrStr]
version: str, python: Path, venv_path: Path, dependency_constraint_flags: Sequence[PathOrStr]
) -> dict[str, str]:
assert python.exists()
virtualenv_app = _ensure_virtualenv()
virtualenv_app = _ensure_virtualenv(version)
allowed_seed_packages = ["pip", "setuptools", "wheel"]
constraints = _parse_constraints_for_virtualenv(
allowed_seed_packages, dependency_constraint_flags
+3 -1
View File
@@ -246,7 +246,9 @@ def setup_python(
log.step("Setting up build environment...")
venv_path = tmp / "venv"
env = virtualenv(base_python, venv_path, dependency_constraint_flags)
env = virtualenv(
python_configuration.version, base_python, venv_path, dependency_constraint_flags
)
# set up environment variables for run_with_env
env["PYTHON_VERSION"] = python_configuration.version