diff --git a/src/packaging/tags.py b/src/packaging/tags.py index d1e12d29..bbc733a5 100644 --- a/src/packaging/tags.py +++ b/src/packaging/tags.py @@ -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. @@ -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]: diff --git a/tasks/check.py b/tasks/check.py index 2c99a5ac..b8f89e65 100644 --- a/tasks/check.py +++ b/tasks/check.py @@ -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), + ) )