Skip to content

Commit 115c35a

Browse files
committed
Set SYSTEM_VERSION_COMPAT=0 during pip install on macos (#1767)
1 parent 554726e commit 115c35a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

cibuildwheel/macos.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,19 +577,30 @@ def build(options: Options, tmp_path: Path) -> None:
577577
package=build_options.package_dir,
578578
)
579579
shell_with_arch(before_test_prepared, env=virtualenv_env)
580+
581+
# setting virtualenv_env used for pip install wheel
582+
# set SYSTEM_VERSION_COMPAT=0 to ensure x86_64 cp38 python on
583+
# arm64 runner can get correct macos version and allow installation
584+
# of wheels with MACOSX_DEPLOYMENT_TARGET >= 11.0
585+
# https://github.com/pypa/cibuildwheel/issues/1767
586+
virtualenv_env_install_wheel = virtualenv_env.copy()
587+
virtualenv_env_install_wheel["SYSTEM_VERSION_COMPAT"] = "0"
580588

581589
# install the wheel
582590
call_with_arch(
583591
"pip",
584592
"install",
585593
f"{repaired_wheel}{build_options.test_extras}",
586-
env=virtualenv_env,
594+
env=virtualenv_env_install_wheel,
587595
)
588596

589597
# test the wheel
590598
if build_options.test_requires:
591599
call_with_arch(
592-
"pip", "install", *build_options.test_requires, env=virtualenv_env
600+
"pip",
601+
"install",
602+
*build_options.test_requires,
603+
env=virtualenv_env_install_wheel,
593604
)
594605

595606
# run the tests from a temp dir, with an absolute path in the command

0 commit comments

Comments
 (0)