From 6940c77cd3450d4435ccd7b1610dd6419b81bc81 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sat, 2 Mar 2024 18:16:20 +0000 Subject: [PATCH] style improvements from code review --- cibuildwheel/macos.py | 6 ++++-- cibuildwheel/windows.py | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index 79eb7bf5..e2970412 100644 --- a/cibuildwheel/macos.py +++ b/cibuildwheel/macos.py @@ -409,8 +409,10 @@ def build(options: Options, tmp_path: Path) -> None: config.version ) ) - build_env["PIP_CONSTRAINT"] = ( - constraint_path.as_uri() + " " + build_env.get("PIP_CONSTRAINT", "") + user_constraints = build_env.get("PIP_CONSTRAINT") + our_constraints = constraint_path.as_uri() + build_env["PIP_CONSTRAINT"] = " ".join( + c for c in [user_constraints, our_constraints] if c ) build_env["VIRTUALENV_PIP"] = get_pip_version(env) call( diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index 30553fc8..4d89b9c9 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -455,9 +455,12 @@ def build(options: Options, tmp_path: Path) -> None: tmp_file.write_bytes(constraints_path.read_bytes()) constraints_path = tmp_file - build_env["PIP_CONSTRAINT"] = ( - str(constraints_path) + " " + build_env.get("PIP_CONSTRAINT", "") + our_constraints = str(constraints_path) + user_constraints = build_env.get("PIP_CONSTRAINT") + build_env["PIP_CONSTRAINT"] = " ".join( + c for c in [our_constraints, user_constraints] if c ) + build_env["VIRTUALENV_PIP"] = get_pip_version(env) call( "python",