Skip to content

Commit 6940c77

Browse files
committed
style improvements from code review
1 parent d65d46c commit 6940c77

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

cibuildwheel/macos.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,10 @@ def build(options: Options, tmp_path: Path) -> None:
409409
config.version
410410
)
411411
)
412-
build_env["PIP_CONSTRAINT"] = (
413-
constraint_path.as_uri() + " " + build_env.get("PIP_CONSTRAINT", "")
412+
user_constraints = build_env.get("PIP_CONSTRAINT")
413+
our_constraints = constraint_path.as_uri()
414+
build_env["PIP_CONSTRAINT"] = " ".join(
415+
c for c in [user_constraints, our_constraints] if c
414416
)
415417
build_env["VIRTUALENV_PIP"] = get_pip_version(env)
416418
call(

cibuildwheel/windows.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,12 @@ def build(options: Options, tmp_path: Path) -> None:
455455
tmp_file.write_bytes(constraints_path.read_bytes())
456456
constraints_path = tmp_file
457457

458-
build_env["PIP_CONSTRAINT"] = (
459-
str(constraints_path) + " " + build_env.get("PIP_CONSTRAINT", "")
458+
our_constraints = str(constraints_path)
459+
user_constraints = build_env.get("PIP_CONSTRAINT")
460+
build_env["PIP_CONSTRAINT"] = " ".join(
461+
c for c in [our_constraints, user_constraints] if c
460462
)
463+
461464
build_env["VIRTUALENV_PIP"] = get_pip_version(env)
462465
call(
463466
"python",

0 commit comments

Comments
 (0)