Skip to content

Commit

Permalink
Revert "Apply new ruff/pyupgrade rule UP032 (#617)"
Browse files Browse the repository at this point in the history
This reverts commit 16206e6.
  • Loading branch information
agronholm committed May 9, 2024
1 parent 16206e6 commit 1e00742
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/wheel/vendored/packaging/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _evaluate_markers(markers: MarkerList, environment: Dict[str, str]) -> bool:


def format_full_version(info: "sys._version_info") -> str:
version = f"{info.major}.{info.minor}.{info.micro}"
version = "{0.major}.{0.minor}.{0.micro}".format(info)
kind = info.releaselevel
if kind != "final":
version += kind[0] + str(info.serial)
Expand Down
24 changes: 19 additions & 5 deletions src/wheel/vendored/packaging/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ def cpython_tags(
if use_abi3:
for minor_version in range(python_version[1] - 1, 1, -1):
for platform_ in platforms:
interpreter = f"cp{_version_nodot((python_version[0], minor_version))}"
interpreter = "cp{version}".format(
version=_version_nodot((python_version[0], minor_version))
)
yield Tag(interpreter, "abi3", platform_)


Expand Down Expand Up @@ -440,7 +442,9 @@ def mac_platforms(
compat_version = 10, 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 "macosx_{major}_{minor}_{binary_format}".format(
major=10, minor=minor_version, binary_format=binary_format
)

if version >= (11, 0):
# Starting with Mac OS 11, each yearly release bumps the major version
Expand All @@ -449,7 +453,9 @@ def mac_platforms(
compat_version = major_version, 0
binary_formats = _mac_binary_formats(compat_version, arch)
for binary_format in binary_formats:
yield f"macosx_{major_version}_0_{binary_format}"
yield "macosx_{major}_{minor}_{binary_format}".format(
major=major_version, minor=0, binary_format=binary_format
)

if version >= (11, 0):
# Mac OS 11 on x86_64 is compatible with binaries from previous releases.
Expand All @@ -464,12 +470,20 @@ def mac_platforms(
compat_version = 10, 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]}_{binary_format}"
yield "macosx_{major}_{minor}_{binary_format}".format(
major=compat_version[0],
minor=compat_version[1],
binary_format=binary_format,
)
else:
for minor_version in range(16, 3, -1):
compat_version = 10, minor_version
binary_format = "universal2"
yield f"macosx_{compat_version[0]}_{compat_version[1]}_{binary_format}"
yield "macosx_{major}_{minor}_{binary_format}".format(
major=compat_version[0],
minor=compat_version[1],
binary_format=binary_format,
)


def _linux_platforms(is_32bit: bool = _32_BIT_INTERPRETER) -> Iterator[str]:
Expand Down

0 comments on commit 1e00742

Please sign in to comment.