From d62c1bee193d9c570fd5de3667b213a95f5d5e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Fri, 30 Sep 2022 15:26:34 +0100 Subject: [PATCH] BUG: ignore macOS minor version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe LaĆ­ns --- mesonpy/__init__.py | 3 +++ tests/test_wheel.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mesonpy/__init__.py b/mesonpy/__init__.py index 169694d70..fe417b378 100644 --- a/mesonpy/__init__.py +++ b/mesonpy/__init__.py @@ -275,6 +275,9 @@ def platform_tag(self) -> str: # latter specifies the target macOS version Python was built # against. parts[1] = platform.mac_ver()[0] + # Only pick up the major version + # https://github.com/FFY00/meson-python/issues/160 + parts[1] = parts[1].split('.')[0] if parts[1] in ('11', '12'): # Workaround for bug where pypa/packaging does not consider macOS diff --git a/tests/test_wheel.py b/tests/test_wheel.py index 894194bc2..c2700e286 100644 --- a/tests/test_wheel.py +++ b/tests/test_wheel.py @@ -51,7 +51,9 @@ platform_ = sysconfig.get_platform() if platform.system() == 'Darwin': parts = platform_.split('-') - parts[1] = platform.mac_ver()[0] + parts[1] = platform.mac_ver()[0].split('.')[0] + if parts[1] in ('11', '12'): + parts[1] += '.0' platform_ = '-'.join(parts) PLATFORM_TAG = platform_.replace('-', '_').replace('.', '_')