1
1
diff --git a/src/pip/_vendor/packaging/tags.py b/src/pip/_vendor/packaging/tags.py
2
- index 6667d2990..bcc6ea041 100644
2
+ index 6667d2990..cb11c60b8 100644
3
3
--- a/src/pip/_vendor/packaging/tags.py
4
4
+++ b/src/pip/_vendor/packaging/tags.py
5
5
@@ -25,7 +25,7 @@ from . import _manylinux, _musllinux
6
6
logger = logging.getLogger(__name__)
7
-
7
+
8
8
PythonVersion = Sequence[int]
9
9
- MacVersion = Tuple[int, int]
10
10
+ AppleVersion = Tuple[int, int]
11
-
11
+
12
12
INTERPRETER_SHORT_NAMES: dict[str, str] = {
13
13
"python": "py", # Generic.
14
14
@@ -363,7 +363,7 @@ def _mac_arch(arch: str, is_32bit: bool = _32_BIT_INTERPRETER) -> str:
15
15
return "i386"
16
-
17
-
16
+
17
+
18
18
- def _mac_binary_formats(version: MacVersion, cpu_arch: str) -> list[str]:
19
19
+ def _mac_binary_formats(version: AppleVersion, cpu_arch: str) -> list[str]:
20
20
formats = [cpu_arch]
21
21
if cpu_arch == "x86_64":
22
22
if version < (10, 4):
23
23
@@ -396,7 +396,7 @@ def _mac_binary_formats(version: MacVersion, cpu_arch: str) -> list[str]:
24
-
25
-
24
+
25
+
26
26
def mac_platforms(
27
27
- version: MacVersion | None = None, arch: str | None = None
28
28
+ version: AppleVersion | None = None, arch: str | None = None
@@ -47,10 +47,10 @@ index 6667d2990..bcc6ea041 100644
47
47
else:
48
48
version = version
49
49
if arch is None:
50
- @@ -483,6 +483,58 @@ def mac_platforms(
50
+ @@ -483,6 +483,63 @@ def mac_platforms(
51
51
)
52
-
53
-
52
+
53
+
54
54
+ def ios_platforms(
55
55
+ version: AppleVersion | None = None, multiarch: str | None = None
56
56
+ ) -> Iterator[str]:
@@ -77,36 +77,41 @@ index 6667d2990..bcc6ea041 100644
77
77
+
78
78
+ ios_platform_template = "ios_{major}_{minor}_{multiarch}"
79
79
+
80
- + # Consider any major.minor version from iOS 12.0 to the version prior to the
81
- + # version requested by platform. 12.0 is the first iOS version that is known
82
- + # to have enough features to support CPython. Consider every possible minor
83
- + # release up to X.9. There highest the minor has ever gone is 8 (14.8 and
84
- + # 15.8) but having some extra candidates that won't ever match doesn't
85
- + # really hurt, and it saves us from having to keep an explicit list of known
86
- + # iOS versions in the code.
87
- + for major in range(12, version[0]):
88
- + for minor in range(0, 10):
89
- + yield ios_platform_template.format(
90
- + major=major, minor=minor, multiarch=multiarch
91
- + )
80
+ + # Consider any iOS major.minor version from the version requested, down to
81
+ + # 12.0. 12.0 is the first iOS version that is known to have enough features
82
+ + # to support CPython. Consider every possible minor release up to X.9. There
83
+ + # highest the minor has ever gone is 8 (14.8 and 15.8) but having some extra
84
+ + # candidates that won't ever match doesn't really hurt, and it saves us from
85
+ + # having to keep an explicit list of known iOS versions in the code. Return
86
+ + # the results descending order of version number.
87
+ +
88
+ + # If the requested major version is less than 12, there won't be any matches.
89
+ + if version[0] < 12:
90
+ + return
91
+ +
92
+ + # Consider the actual X.Y version that was requested.
93
+ + yield ios_platform_template.format(
94
+ + major=version[0], minor=version[1], multiarch=multiarch
95
+ + )
92
96
+
93
97
+ # Consider every minor version from X.0 to the minor version prior to the
94
98
+ # version requested by the platform.
95
- + for minor in range(0, version[1]):
99
+ + for minor in range(version[1] - 1, -1, -1 ):
96
100
+ yield ios_platform_template.format(
97
101
+ major=version[0], minor=minor, multiarch=multiarch
98
102
+ )
99
103
+
100
- + # Consider the actual X.Y version that was requested.
101
- + yield ios_platform_template.format(
102
- + major=version[0], minor=version[1], multiarch=multiarch
103
- + )
104
+ + for major in range(version[0] - 1, 11, -1):
105
+ + for minor in range(9, -1, -1):
106
+ + yield ios_platform_template.format(
107
+ + major=major, minor=minor, multiarch=multiarch
108
+ + )
104
109
+
105
110
+
106
111
def _linux_platforms(is_32bit: bool = _32_BIT_INTERPRETER) -> Iterator[str]:
107
112
linux = _normalize_string(sysconfig.get_platform())
108
113
if not linux.startswith("linux_"):
109
- @@ -512,6 +563 ,8 @@ def platform_tags() -> Iterator[str]:
114
+ @@ -512,6 +569 ,8 @@ def platform_tags() -> Iterator[str]:
110
115
"""
111
116
if platform.system() == "Darwin":
112
117
return mac_platforms()
0 commit comments