From 1f784a1a29a79470f93c062139ea6080a1d1f831 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Mon, 9 Dec 2019 09:03:29 +0100 Subject: [PATCH] fix conflicts with main branch --- test/10_cpp_standards/cibuildwheel_test.py | 9 ++++++--- test/shared/utils.py | 19 +++++++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/test/10_cpp_standards/cibuildwheel_test.py b/test/10_cpp_standards/cibuildwheel_test.py index 04734c8b..ef53c4ad 100644 --- a/test/10_cpp_standards/cibuildwheel_test.py +++ b/test/10_cpp_standards/cibuildwheel_test.py @@ -15,7 +15,8 @@ def test_cpp11(tmp_path): # this test checks if c++11 standard is supported. actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env) - expected_wheels = [x for x in utils.expected_wheels('spam', '0.1.0', "10.9") if "cp27-cp27m-win" not in x] + expected_wheels = [x for x in utils.expected_wheels('spam', '0.1.0', + macosx_deployment_target="10.9") if "cp27-cp27m-win" not in x] assert set(actual_wheels) == set(expected_wheels) @@ -30,7 +31,8 @@ def test_cpp14(): # this test checks if c++14 standard is supported. actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env) - expected_wheels = [x for x in utils.expected_wheels('spam', '0.1.0', "10.9") + expected_wheels = [x for x in utils.expected_wheels( + 'spam', '0.1.0', macosx_deployment_target="10.9") if "cp27-cp27m-win" not in x and "cp35-cp35m-win" not in x] assert set(actual_wheels) == set(expected_wheels) @@ -49,7 +51,8 @@ def test_cpp17(): # this test checks if c++17 standard is supported. actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env) - expected_wheels = [x for x in utils.expected_wheels('spam', '0.1.0', "10.13") + expected_wheels = [x for x in utils.expected_wheels('spam', '0.1.0', + macosx_deployment_target="10.13") if "cp27-cp27m-win" not in x and "cp35-cp35m-win" not in x] assert set(actual_wheels) == set(expected_wheels) diff --git a/test/shared/utils.py b/test/shared/utils.py index 4939b64e..3615a3db 100644 --- a/test/shared/utils.py +++ b/test/shared/utils.py @@ -66,7 +66,8 @@ def cibuildwheel_run(project_path, env=None, add_env=None, output_dir=None): return wheels -def expected_wheels(package_name, package_version, manylinux_versions=['manylinux1', 'manylinux2010']): +def expected_wheels(package_name, package_version, manylinux_versions=['manylinux1', 'manylinux2010'], + macosx_deployment_target=None): ''' Returns a list of expected wheels from a run of cibuildwheel. ''' @@ -83,20 +84,30 @@ def expected_wheels(package_name, package_version, manylinux_versions=['manylinu platform_tags.append('{manylinux_version}_{architecture}'.format( manylinux_version=manylinux_version, architecture=architecture )) + def get_platform_tags(python_abi_tag): return platform_tags + elif platform == 'windows': + def get_platform_tags(python_abi_tag): return ['win32', 'win_amd64'] + elif platform == 'macos': + if macosx_deployment_target is not None: + tag = macosx_deployment_target.replace(".", "_") + tag1 = macosx_deployment_target.replace(".", "_") + else: + tag = os.environ.get("MACOSX_DEPLOYMENT_TARGET", "10_6").replace(".", "_") + tag1 = os.environ.get("MACOSX_DEPLOYMENT_TARGET", "10_9").replace(".", "_") + def get_platform_tags(python_abi_tag): if python_abi_tag == 'cp38-cp38': - return ['macosx_10_9_x86_64'] + return ['macosx_' + tag1 + '_x86_64'] else: - return ['macosx_10_6_intel'] + return ['macosx_' + tag + '_intel'] else: raise Exception('unsupported platform') - templates = [] for python_abi_tag in python_abi_tags: for platform_tag in get_platform_tags(python_abi_tag):