Skip to content

Commit 76d0c76

Browse files
committed
feature: allow testing cp38-macosx_arm64 wheel
Per discussion in pypa#1169, the default installer used for cp38 is an Intel installer. It makes sense to skip testing arm64 wheels in this case. However, if the user choose to manually install the universal2 CPython version, then, tests shall be run on arm64. This allows users that either target 11.0+ on intel, universal2 or only build for arm64 to get the arm64 wheel tested on AppleSilicon.
1 parent 7c45799 commit 76d0c76

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cibuildwheel/macos.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,13 @@ def build(options: Options, tmp_path: Path) -> None:
425425

426426
if build_options.test_command and build_options.test_selector(config.identifier):
427427
machine_arch = platform.machine()
428+
python_arch = call(
429+
"python",
430+
"-sSc",
431+
"import platform; print(platform.machine())",
432+
env=env,
433+
capture_stdout=True,
434+
).strip()
428435
testing_archs: list[Literal["x86_64", "arm64"]]
429436

430437
if config_is_arm64:
@@ -473,7 +480,8 @@ def build(options: Options, tmp_path: Path) -> None:
473480
# skip this test
474481
continue
475482

476-
if testing_arch == "arm64" and config.identifier.startswith("cp38-"):
483+
is_cp38 = config.identifier.startswith("cp38-")
484+
if testing_arch == "arm64" and is_cp38 and python_arch != "arm64":
477485
log.warning(
478486
unwrap(
479487
"""

0 commit comments

Comments
 (0)