From 14c83f1b9b92b51508308417602e674b81e6dd28 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Thu, 9 Sep 2021 15:28:10 +0100 Subject: [PATCH 1/4] Add test for #818 --- test/test_wheel_tag.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/test_wheel_tag.py diff --git a/test/test_wheel_tag.py b/test/test_wheel_tag.py new file mode 100644 index 00000000..ccfb2d3d --- /dev/null +++ b/test/test_wheel_tag.py @@ -0,0 +1,34 @@ +import pytest + +from . import test_projects, utils + +basic_project = test_projects.new_c_project() + + +@pytest.mark.xfail(strict=True) +def test(tmp_path): + if utils.platform != "macos": + pytest.skip() + project_dir = tmp_path / "project" + basic_project.generate(project_dir) + + # build the wheels + deployment_target = "10.11" + actual_wheels = utils.cibuildwheel_run( + project_dir, + add_env={ + "CIBW_BUILD": "cp39-*", + "MACOSX_DEPLOYMENT_TARGET": deployment_target, + }, + ) + + # check that the expected wheels are produced + expected_wheels = utils.expected_wheels( + "spam", "0.1.0", macosx_deployment_target=deployment_target + ) + expected_wheels = [w for w in expected_wheels if "cp39" in w] + + print("actual_wheels", actual_wheels) + print("expected_wheels", expected_wheels) + + assert set(actual_wheels) == set(expected_wheels) From f0b4c74c0f5deb48d0fff5b2ff90a904a81a4785 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Mon, 13 Sep 2021 09:19:06 +0100 Subject: [PATCH 2/4] Remove xfail on test --- test/test_wheel_tag.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_wheel_tag.py b/test/test_wheel_tag.py index ccfb2d3d..123a3355 100644 --- a/test/test_wheel_tag.py +++ b/test/test_wheel_tag.py @@ -5,7 +5,6 @@ from . import test_projects, utils basic_project = test_projects.new_c_project() -@pytest.mark.xfail(strict=True) def test(tmp_path): if utils.platform != "macos": pytest.skip() From 7d67e7acb687beb3f99dcdcaabb9867c63fde4ef Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Mon, 13 Sep 2021 09:20:41 +0100 Subject: [PATCH 3/4] Some comments and explaination --- test/test_wheel_tag.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_wheel_tag.py b/test/test_wheel_tag.py index 123a3355..b42cb8f2 100644 --- a/test/test_wheel_tag.py +++ b/test/test_wheel_tag.py @@ -5,9 +5,10 @@ from . import test_projects, utils basic_project = test_projects.new_c_project() -def test(tmp_path): +def test_wheel_tag_is_correct_when_using_macosx_deployment_target(tmp_path): if utils.platform != "macos": - pytest.skip() + pytest.skip('This test is only relevant to MACOSX_DEPLOYMENT_TARGET') + project_dir = tmp_path / "project" basic_project.generate(project_dir) From 37e057657cda7bbb8fe2ffc0f7b7c5306c478d7f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 08:21:02 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- test/test_wheel_tag.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_wheel_tag.py b/test/test_wheel_tag.py index b42cb8f2..a026b2d7 100644 --- a/test/test_wheel_tag.py +++ b/test/test_wheel_tag.py @@ -7,7 +7,7 @@ basic_project = test_projects.new_c_project() def test_wheel_tag_is_correct_when_using_macosx_deployment_target(tmp_path): if utils.platform != "macos": - pytest.skip('This test is only relevant to MACOSX_DEPLOYMENT_TARGET') + pytest.skip("This test is only relevant to MACOSX_DEPLOYMENT_TARGET") project_dir = tmp_path / "project" basic_project.generate(project_dir)