Skip to content

Commit

Permalink
Attempt for improvment based on review
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed May 10, 2024
1 parent c0522ef commit e7b3222
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 21 deletions.
22 changes: 11 additions & 11 deletions src/packaging/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,20 +434,22 @@ def mac_platforms(
if (10, 0) <= version and version < (11, 0):
# Prior to Mac OS 11, each yearly release of Mac OS bumped the
# "minor" version number. The major version was always 10.
major_version = 10
for minor_version in range(version[1], -1, -1):
compat_version = 10, minor_version
compat_version = major_version, minor_version
binary_formats = _mac_binary_formats(compat_version, arch)
for binary_format in binary_formats:
yield f"macosx_10_{minor_version}_{binary_format}"
yield f"macosx_{major_version}_{minor_version}_{binary_format}"

if version >= (11, 0):
# Starting with Mac OS 11, each yearly release bumps the major version
# number. The minor versions are now the midyear updates.
minor_version = 0
for major_version in range(version[0], 10, -1):
compat_version = major_version, 0
compat_version = major_version, minor_version
binary_formats = _mac_binary_formats(compat_version, arch)
for binary_format in binary_formats:
yield f"macosx_{major_version}_0_{binary_format}"
yield f"macosx_{major_version}_{minor_version}_{binary_format}"

if version >= (11, 0):
# Mac OS 11 on x86_64 is compatible with binaries from previous releases.
Expand All @@ -457,20 +459,18 @@ def mac_platforms(
# However, the "universal2" binary format can have a
# macOS version earlier than 11.0 when the x86_64 part of the binary supports
# that version of macOS.
major_version = 10
if arch == "x86_64":
for minor_version in range(16, 3, -1):
compat_version = 10, minor_version
compat_version = major_version, minor_version
binary_formats = _mac_binary_formats(compat_version, arch)
for binary_format in binary_formats:
yield (
f"macosx_{compat_version[0]}_{compat_version[1]}"
f"_{binary_format}"
)
yield f"macosx_{major_version}_{minor_version}_{binary_format}"
else:
for minor_version in range(16, 3, -1):
compat_version = 10, minor_version
compat_version = major_version, minor_version
binary_format = "universal2"
yield f"macosx_{compat_version[0]}_{compat_version[1]}_{binary_format}"
yield f"macosx_{major_version}_{minor_version}_{binary_format}"


def _linux_platforms(is_32bit: bool = _32_BIT_INTERPRETER) -> Iterator[str]:
Expand Down
33 changes: 23 additions & 10 deletions tasks/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,35 @@ def pep440(cached=False):

# Print out our findings
print(
f"Total Version Compatibility: {len(parsed_versions)}/"
f"{len(all_versions)} ({len(parsed_versions) / len(all_versions):.2%})"
"Total Version Compatibility: {}/{} ({:.2%})".format( # noqa: UP032
len(parsed_versions),
len(all_versions),
len(parsed_versions) / len(all_versions),
)
)
print(
f"Total Sorting Compatibility (Unfiltered): {len(compatible_sorting)}/"
f"{len(data)} ({len(compatible_sorting) / len(data):.2%})"
"Total Sorting Compatibility (Unfiltered): {}/{} ({:.2%})".format( # noqa: UP032
len(compatible_sorting), len(data), len(compatible_sorting) / len(data)
)
)
print(
f"Total Sorting Compatibility (Filtered): {len(filtered_compatible_sorting)}/"
f"{len(data)} ({len(filtered_compatible_sorting) / len(data):.2%})"
"Total Sorting Compatibility (Filtered): {}/{} ({:.2%})".format( # noqa: UP032
len(filtered_compatible_sorting),
len(data),
len(filtered_compatible_sorting) / len(data),
)
)
print(
f"Projects with No Compatible Versions: {len(only_invalid_versions)}/"
f"{len(data)} ({len(only_invalid_versions) / len(data):.2%})"
"Projects with No Compatible Versions: {}/{} ({:.2%})".format( # noqa: UP032
len(only_invalid_versions),
len(data),
len(only_invalid_versions) / len(data),
)
)
print(
f"Projects with Differing Latest Version: {len(differing_latest_versions)}/"
f"{len(data)} ({len(differing_latest_versions) / len(data):.2%})"
"Projects with Differing Latest Version: {}/{} ({:.2%})".format( # noqa: UP032
len(differing_latest_versions),
len(data),
len(differing_latest_versions) / len(data),
)
)

0 comments on commit e7b3222

Please sign in to comment.