Skip to content

Commit e2a0839

Browse files
laggykillerpre-commit-ci[bot]joerick
authored
fix: set SYSTEM_VERSION_COMPAT=0 during pip install on macos (#1768)
* Set SYSTEM_VERSION_COMPAT=0 during pip install on macos (#1767) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Only set SYSTEM_VERSION_COMPAT=0 for CPython 3.8 * Set SYSTEM_VERSION_COMPAT=0 for CPython <= 3.8 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update cibuildwheel/macos.py Co-authored-by: Joe Rickerby <[email protected]> * Update cibuildwheel/macos.py Co-authored-by: Joe Rickerby <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Joe Rickerby <[email protected]>
1 parent 87fff77 commit e2a0839

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

cibuildwheel/macos.py

+22-2
Original file line numberDiff line numberDiff line change
@@ -583,17 +583,37 @@ def build(options: Options, tmp_path: Path) -> None:
583583
shell_with_arch(before_test_prepared, env=virtualenv_env)
584584

585585
# install the wheel
586+
if is_cp38 and python_arch == "x86_64":
587+
virtualenv_env_install_wheel = virtualenv_env.copy()
588+
virtualenv_env_install_wheel["SYSTEM_VERSION_COMPAT"] = "0"
589+
log.notice(
590+
unwrap(
591+
"""
592+
Setting SYSTEM_VERSION_COMPAT=0 to ensure CPython 3.8 can get
593+
correct macOS version and allow installation of wheels with
594+
MACOSX_DEPLOYMENT_TARGET >= 11.0.
595+
See https://github.com/pypa/cibuildwheel/issues/1767 for the
596+
details.
597+
"""
598+
)
599+
)
600+
else:
601+
virtualenv_env_install_wheel = virtualenv_env
602+
586603
call_with_arch(
587604
"pip",
588605
"install",
589606
f"{repaired_wheel}{build_options.test_extras}",
590-
env=virtualenv_env,
607+
env=virtualenv_env_install_wheel,
591608
)
592609

593610
# test the wheel
594611
if build_options.test_requires:
595612
call_with_arch(
596-
"pip", "install", *build_options.test_requires, env=virtualenv_env
613+
"pip",
614+
"install",
615+
*build_options.test_requires,
616+
env=virtualenv_env_install_wheel,
597617
)
598618

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

0 commit comments

Comments
 (0)