diff options
| author | Grzegorz Bokota <bokota+github@gmail.com> | 2020-12-04 11:48:08 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-04 12:48:08 +0200 |
| commit | e6102e58153fa43089b920e3908eeb908170cf44 (patch) | |
| tree | 22e46a73d411e72efca43246898714d998c1459e /tests | |
| parent | 39b6397ba944d82f1fe37d043382f97b78a919d6 (diff) | |
| download | wheel-git-e6102e58153fa43089b920e3908eeb908170cf44.tar.gz | |
Fixed error on Big Sur when deployment target = 11 (#386)
Fixes #385.
Co-authored-by: FX Coudert <fxcoudert@gmail.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_macosx_libfile.py | 28 | ||||
| -rw-r--r-- | tests/testdata/macosx_minimal_system_version/test_lib_11.dylib | bin | 0 -> 16464 bytes |
2 files changed, 24 insertions, 4 deletions
diff --git a/tests/test_macosx_libfile.py b/tests/test_macosx_libfile.py index 35cff83..337f0e3 100644 --- a/tests/test_macosx_libfile.py +++ b/tests/test_macosx_libfile.py @@ -21,7 +21,8 @@ def test_read_from_dylib(): ("test_lib_10_10_386.dylib", "10.10.0"), ("test_lib_10_14_386.dylib", "10.14.0"), ("test_lib_multiple_fat.dylib", "10.14.0"), - ("test_lib_10_10_10.dylib", "10.10.10") + ("test_lib_10_10_10.dylib", "10.10.10"), + ("test_lib_11.dylib", "11.0.0"), ] for file_name, ver in versions: extracted = extract_macosx_min_system_version( @@ -48,14 +49,14 @@ class TestGetPlatformMacosx: def test_simple(self, monkeypatch): dirname = os.path.dirname(__file__) dylib_dir = os.path.join(dirname, "testdata", "macosx_minimal_system_version") - monkeypatch.setattr(distutils.util, "get_platform", return_factory("macosx-10.14-x86_64")) - assert get_platform(dylib_dir) == "macosx_10_14_x86_64" + monkeypatch.setattr(distutils.util, "get_platform", return_factory("macosx-11.0-x86_64")) + assert get_platform(dylib_dir) == "macosx_11_0_x86_64" def test_version_bump(self, monkeypatch, capsys): dirname = os.path.dirname(__file__) dylib_dir = os.path.join(dirname, "testdata", "macosx_minimal_system_version") monkeypatch.setattr(distutils.util, "get_platform", return_factory("macosx-10.9-x86_64")) - assert get_platform(dylib_dir) == "macosx_10_14_x86_64" + assert get_platform(dylib_dir) == "macosx_11_0_x86_64" captured = capsys.readouterr() assert "[WARNING] This wheel needs a higher macOS version than" in captured.err @@ -127,6 +128,25 @@ class TestGetPlatformMacosx: captured = capsys.readouterr() assert "MACOSX_DEPLOYMENT_TARGET is set to a lower value (10.8) than the" in captured.err + def test_get_platform_bigsur_env(self, monkeypatch): + dirname = os.path.dirname(__file__) + dylib_dir = os.path.join(dirname, "testdata", "macosx_minimal_system_version") + monkeypatch.setattr(distutils.util, "get_platform", return_factory("macosx-10.9-x86_64")) + monkeypatch.setenv("MACOSX_DEPLOYMENT_TARGET", "11") + monkeypatch.setattr(os, "walk", return_factory( + [(dylib_dir, [], ["test_lib_10_6.dylib", "test_lib_10_10_fat.dylib"])] + )) + assert get_platform(dylib_dir) == "macosx_11_0_x86_64" + + def test_get_platform_bigsur_platform(self, monkeypatch): + dirname = os.path.dirname(__file__) + dylib_dir = os.path.join(dirname, "testdata", "macosx_minimal_system_version") + monkeypatch.setattr(distutils.util, "get_platform", return_factory("macosx-11-x86_64")) + monkeypatch.setattr(os, "walk", return_factory( + [(dylib_dir, [], ["test_lib_10_6.dylib", "test_lib_10_10_fat.dylib"])] + )) + assert get_platform(dylib_dir) == "macosx_11_0_x86_64" + def test_get_platform_linux(monkeypatch): monkeypatch.setattr(distutils.util, "get_platform", return_factory("linux_x86_64")) diff --git a/tests/testdata/macosx_minimal_system_version/test_lib_11.dylib b/tests/testdata/macosx_minimal_system_version/test_lib_11.dylib Binary files differnew file mode 100644 index 0000000..80202c1 --- /dev/null +++ b/tests/testdata/macosx_minimal_system_version/test_lib_11.dylib |
