Fix macOS Big Sur version checks
This commit is contained in:
@@ -33,6 +33,7 @@ def get_macos_version() -> Tuple[int, int]:
|
||||
|
||||
These tuples can be used in comparisons, e.g.
|
||||
(10, 14) <= (11, 0) == True
|
||||
(10, 14) <= (10, 16) == True
|
||||
(11, 2) <= (11, 0) != True
|
||||
'''
|
||||
version_str, _, _ = platform.mac_ver()
|
||||
@@ -71,7 +72,9 @@ def get_python_configurations(build_selector: BuildSelector,
|
||||
# skip builds as required by BUILD/SKIP
|
||||
python_configurations = [c for c in python_configurations if build_selector(c.identifier)]
|
||||
|
||||
if get_macos_version() >= (11, 0):
|
||||
# When running on macOS 11 in x86_64 mode, the reported OS is the
|
||||
# non-existent '10.16'.
|
||||
if get_macos_version() >= (10, 16):
|
||||
if any(c.identifier.startswith('pp') for c in python_configurations):
|
||||
# pypy doesn't work on macOS 11 yet
|
||||
# See https://foss.heptapod.net/pypy/pypy/-/issues/3314
|
||||
|
||||
@@ -14,7 +14,7 @@ ALL_MACOS_WHEELS = (
|
||||
def test_cross_compiled_build(tmp_path):
|
||||
if utils.platform != 'macos':
|
||||
pytest.skip('this test is only relevant to macos')
|
||||
if utils.get_macos_version() < (11, 0):
|
||||
if utils.get_macos_version() < (10, 16):
|
||||
pytest.skip('this test only works on macOS 11 or greater')
|
||||
|
||||
project_dir = tmp_path / 'project'
|
||||
@@ -33,7 +33,7 @@ def test_cross_compiled_build(tmp_path):
|
||||
def test_cross_compiled_test(tmp_path, capfd, build_universal2):
|
||||
if utils.platform != 'macos':
|
||||
pytest.skip('this test is only relevant to macos')
|
||||
if utils.get_macos_version() < (11, 0):
|
||||
if utils.get_macos_version() < (10, 16):
|
||||
pytest.skip('this test only works on macOS 11 or greater')
|
||||
|
||||
project_dir = tmp_path / 'project'
|
||||
|
||||
Reference in New Issue
Block a user