@@ -401,12 +401,12 @@ def build(options: Options, tmp_path: Path) -> None:
401
401
identifier_tmp_dir .mkdir ()
402
402
built_wheel_dir = identifier_tmp_dir / "built_wheel"
403
403
404
- dependency_constraint_flags : Sequence [ PathOrStr ] = []
405
- if build_options . dependency_constraints :
406
- dependency_constraint_flags = [
407
- "-c" ,
408
- build_options . dependency_constraints . get_for_python_version ( config . version ),
409
- ]
404
+ constraints_path = build_options . dependency_constraints . get_for_python_version (
405
+ version = config . version , tmp_dir = identifier_tmp_dir
406
+ )
407
+ dependency_constraint_flags : Sequence [ PathOrStr ] = (
408
+ [ "-c" , constraints_path ] if constraints_path else []
409
+ )
410
410
411
411
target_install_path , env = setup_python (
412
412
identifier_tmp_dir / "build" ,
@@ -445,11 +445,8 @@ def build(options: Options, tmp_path: Path) -> None:
445
445
446
446
build_env = env .copy ()
447
447
build_env ["VIRTUALENV_PIP" ] = pip_version
448
- if build_options .dependency_constraints :
449
- constraint_path = build_options .dependency_constraints .get_for_python_version (
450
- config .version
451
- )
452
- combine_constraints (build_env , constraint_path , None )
448
+ if constraints_path :
449
+ combine_constraints (build_env , constraints_path , None )
453
450
454
451
if build_frontend .name == "pip" :
455
452
# Path.resolve() is needed. Without it pip wheel may try to
0 commit comments