Skip to content

Commit

Permalink
Warn on deceptive platform version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
HexDecimal committed Jul 6, 2024
1 parent a9f5fd7 commit 32ea3e1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions delocate/delocating.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,17 @@ def get_release_version(version: Version) -> str:
"""Return the macOS release version from the given actual version."""
if require_target_macos_version is not None:
version = max(version, require_target_macos_version)
elif version.major >= 11 and version.minor > 0:
# Warn when the platform tag is given a deceptive version number.
logger.warning(
"Wheel will be marked as supporting macOS %i,"
" but will not support macOS versions before %i.%i.\n"
"Configure MACOSX_DEPLOYMENT_TARGET to suppress this warning.",
version.major,
version.major,
version.minor,
)

return f"{version.major}_{0 if version.major >= 11 else version.minor}"

platform_tag = ".".join(
Expand Down

0 comments on commit 32ea3e1

Please sign in to comment.