13
13
interpreter_name ,
14
14
interpreter_version ,
15
15
mac_platforms ,
16
+ ios_platforms ,
16
17
)
17
18
18
- _osx_arch_pat = re .compile (r"(.+)_(\d+)_(\d+)_(.+)" )
19
+ _apple_arch_pat = re .compile (r"(.+)_(\d+)_(\d+)_(.+)" )
19
20
20
21
21
22
def version_info_to_nodot (version_info : Tuple [int , ...]) -> str :
@@ -24,7 +25,7 @@ def version_info_to_nodot(version_info: Tuple[int, ...]) -> str:
24
25
25
26
26
27
def _mac_platforms (arch : str ) -> List [str ]:
27
- match = _osx_arch_pat .match (arch )
28
+ match = _apple_arch_pat .match (arch )
28
29
if match :
29
30
name , major , minor , actual_arch = match .groups ()
30
31
mac_version = (int (major ), int (minor ))
@@ -43,6 +44,26 @@ def _mac_platforms(arch: str) -> List[str]:
43
44
return arches
44
45
45
46
47
+ def _ios_platforms (arch : str ) -> List [str ]:
48
+ match = _apple_arch_pat .match (arch )
49
+ if match :
50
+ name , major , minor , actual_multiarch = match .groups ()
51
+ ios_version = (int (major ), int (minor ))
52
+ arches = [
53
+ # Since we have always only checked that the platform starts
54
+ # with "ios", for backwards-compatibility we extract the
55
+ # actual prefix provided by the user in case they provided
56
+ # something like "ioscustom_". It may be good to remove
57
+ # this as undocumented or deprecate it in the future.
58
+ "{}_{}" .format (name , arch [len ("ios_" ) :])
59
+ for arch in ios_platforms (ios_version , actual_multiarch )
60
+ ]
61
+ else :
62
+ # arch pattern didn't match (?!)
63
+ arches = [arch ]
64
+ return arches
65
+
66
+
46
67
def _custom_manylinux_platforms (arch : str ) -> List [str ]:
47
68
arches = [arch ]
48
69
arch_prefix , arch_sep , arch_suffix = arch .partition ("_" )
@@ -68,6 +89,8 @@ def _get_custom_platforms(arch: str) -> List[str]:
68
89
arch_prefix , arch_sep , arch_suffix = arch .partition ("_" )
69
90
if arch .startswith ("macosx" ):
70
91
arches = _mac_platforms (arch )
92
+ elif arch .startswith ("ios" ):
93
+ arches = _ios_platforms (arch )
71
94
elif arch_prefix in ["manylinux2014" , "manylinux2010" ]:
72
95
arches = _custom_manylinux_platforms (arch )
73
96
else :
0 commit comments