From ac42f66a7234eaf9949f8c95870f918a532c9ca9 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Mon, 8 Aug 2022 18:20:57 +0100 Subject: [PATCH] Change expected_wheels to only expect universal2 when a flag is passed --- test/test_macos_archs.py | 2 +- test/utils.py | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/test/test_macos_archs.py b/test/test_macos_archs.py index d3a56fb7..fdd665c0 100644 --- a/test/test_macos_archs.py +++ b/test/test_macos_archs.py @@ -11,7 +11,7 @@ basic_project = test_projects.new_c_project() ALL_MACOS_WHEELS = { *utils.expected_wheels("spam", "0.1.0", machine_arch="x86_64"), - *utils.expected_wheels("spam", "0.1.0", machine_arch="arm64"), + *utils.expected_wheels("spam", "0.1.0", machine_arch="arm64", include_universal2=True), } diff --git a/test/utils.py b/test/utils.py index 947c8968..5d610516 100644 --- a/test/utils.py +++ b/test/utils.py @@ -116,6 +116,7 @@ def expected_wheels( macosx_deployment_target="10.9", machine_arch=None, python_abi_tags=None, + include_universal2=False, ): """ Returns a list of expected wheels from a run of cibuildwheel. @@ -199,14 +200,14 @@ def expected_wheels( arm64_macosx_deployment_target = _get_arm64_macosx_deployment_target( macosx_deployment_target ) - platform_tags = [ - f'macosx_{macosx_deployment_target.replace(".", "_")}_universal2', - f'macosx_{arm64_macosx_deployment_target.replace(".", "_")}_arm64', - ] + platform_tags = [f'macosx_{arm64_macosx_deployment_target.replace(".", "_")}_arm64'] else: - platform_tags = [ - f'macosx_{macosx_deployment_target.replace(".", "_")}_x86_64', - ] + platform_tags = [f'macosx_{macosx_deployment_target.replace(".", "_")}_x86_64'] + + if include_universal2: + platform_tags.append( + f'macosx_{macosx_deployment_target.replace(".", "_")}_universal2', + ) else: raise Exception("unsupported platform")