Skip to content

BUG: ignore macOS minor version #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions mesonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tests/test_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it > '11', to avoid this breaking as soon as macOS 13 comes out?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is that packaging would have this fixed by then.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even with that fix, it still needs to be 13.0 for any 13.x OS version in the absence of MACOSX_DEPLOYMENT_PLATFORM. The packaging fix is only for when MACOSX_DEPLOYMENT_PLATFORM is explicitly set.

parts[1] += '.0'
platform_ = '-'.join(parts)
PLATFORM_TAG = platform_.replace('-', '_').replace('.', '_')

Expand Down