Skip to content

Commit 5c75fae

Browse files
authored
Correct handling of fat3 macOS wheels and eggs. (#17572)
1 parent ef958a6 commit 5c75fae

File tree

4 files changed

+39
-3
lines changed

4 files changed

+39
-3
lines changed

tests/unit/forklift/test_legacy.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2722,7 +2722,14 @@ def test_upload_attestation_fails_without_oidc_publisher(
27222722
"manylinux_2_17_ppc64le",
27232723
"manylinux_3_0_s390x",
27242724
"musllinux_1_1_x86_64",
2725-
"macosx_10_6_intel",
2725+
"macosx_10_5_ppc",
2726+
"macosx_10_5_ppc64",
2727+
"macosx_10_5_i386",
2728+
"macosx_10_5_intel",
2729+
"macosx_10_5_fat",
2730+
"macosx_10_5_fat3",
2731+
"macosx_10_5_fat64",
2732+
"macosx_10_5_universal",
27262733
"macosx_10_13_x86_64",
27272734
"macosx_11_0_x86_64",
27282735
"macosx_10_15_arm64",

tests/unit/utils/test_wheel.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
("filename", "expected_tags"),
2020
[
2121
("cryptography-42.0.5.tar.gz", ["Source"]),
22+
("Pillow-2.5.0-py3.4-win-amd64.egg", ["Egg"]),
23+
("Pillow-2.5.0-py3.4-win32.egg", ["Egg"]),
2224
(
2325
"cryptography-42.0.5-pp310-pypy310_pp73-win_amd64.whl",
2426
["PyPy", "Windows x86-64"],
@@ -31,6 +33,26 @@
3133
"cryptography-42.0.5-cp37-abi3-musllinux_1_2_x86_64.whl",
3234
["CPython 3.7+", "musllinux: musl 1.2+ x86-64"],
3335
),
36+
(
37+
"cryptography-42.0.5-cp37-abi3-macosx_10_5_intel.whl",
38+
["CPython 3.7+", "macOS 10.5+ Intel (x86-64, i386)"],
39+
),
40+
(
41+
"cryptography-42.0.5-cp37-abi3-macosx_10_5_fat.whl",
42+
["CPython 3.7+", "macOS 10.5+ fat (i386, PPC)"],
43+
),
44+
(
45+
"cryptography-42.0.5-cp37-abi3-macosx_10_5_fat3.whl",
46+
["CPython 3.7+", "macOS 10.5+ fat3 (x86-64, i386, PPC)"],
47+
),
48+
(
49+
"cryptography-42.0.5-cp37-abi3-macosx_10_5_fat64.whl",
50+
["CPython 3.7+", "macOS 10.5+ fat64 (x86-64, PPC64)"],
51+
),
52+
(
53+
"cryptography-42.0.5-cp37-abi3-macosx_10_5_universal.whl",
54+
["CPython 3.7+", "macOS 10.5+ universal (x86-64, i386, PPC64, PPC)"],
55+
),
3456
(
3557
"cryptography-42.0.5-cp37-abi3-macosx_10_12_universal2.whl",
3658
["CPython 3.7+", "macOS 10.12+ universal2 (ARM64, x86-64)"],

warehouse/forklift/legacy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
"arm64",
141141
"intel",
142142
"fat",
143-
"fat32",
143+
"fat3",
144144
"fat64",
145145
"universal",
146146
"universal2",

warehouse/utils/wheel.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
"amd64": "x86-64",
4747
"aarch64": "ARM64",
4848
"x86_64": "x86-64",
49+
"intel": "Intel (x86-64, i386)",
50+
"fat": "fat (i386, PPC)",
51+
"fat3": "fat3 (x86-64, i386, PPC)",
52+
"fat64": "fat64 (x86-64, PPC64)",
53+
"universal": "universal (x86-64, i386, PPC64, PPC)",
4954
"universal2": "universal2 (ARM64, x86-64)",
5055
"arm64": "ARM64",
5156
"armv7l": "ARMv7l",
@@ -61,7 +66,9 @@ def _format_version(s: str) -> str:
6166

6267

6368
def filename_to_pretty_tags(filename: str) -> list[str]:
64-
if not filename.endswith(".whl"):
69+
if filename.endswith(".egg"):
70+
return ["Egg"]
71+
elif not filename.endswith(".whl"):
6572
return ["Source"]
6673

6774
try:

0 commit comments

Comments
 (0)