Skip to content

Commit

Permalink
feature: allow testing cp38-macosx_arm64 wheel
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mayeut committed Sep 25, 2022
1 parent 7c45799 commit 76d0c76
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cibuildwheel/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,13 @@ def build(options: Options, tmp_path: Path) -> None:

if build_options.test_command and build_options.test_selector(config.identifier):
machine_arch = platform.machine()
python_arch = call(
"python",
"-sSc",
"import platform; print(platform.machine())",
env=env,
capture_stdout=True,
).strip()
testing_archs: list[Literal["x86_64", "arm64"]]

if config_is_arm64:
Expand Down Expand Up @@ -473,7 +480,8 @@ def build(options: Options, tmp_path: Path) -> None:
# skip this test
continue

if testing_arch == "arm64" and config.identifier.startswith("cp38-"):
is_cp38 = config.identifier.startswith("cp38-")
if testing_arch == "arm64" and is_cp38 and python_arch != "arm64":
log.warning(
unwrap(
"""
Expand Down

0 comments on commit 76d0c76

Please # to comment.