@@ -163,6 +163,57 @@ def expected_wheels(
163163 include_universal2 : bool = False ,
164164 single_python : bool = False ,
165165 single_arch : bool = False ,
166+ ) -> list [str ]:
167+ """
168+ Returns a list of expected wheels from a run of cibuildwheel.
169+ """
170+ if machine_arch is None :
171+ machine_arch = pm .machine ()
172+ if platform == "linux" :
173+ machine_arch = arch_name_for_linux (machine_arch )
174+
175+ architectures = [machine_arch ]
176+ if not single_arch :
177+ if platform == "linux" :
178+ if machine_arch == "x86_64" :
179+ architectures .append ("i686" )
180+ elif (
181+ machine_arch == "aarch64"
182+ and sys .platform .startswith ("linux" )
183+ and _AARCH64_CAN_RUN_ARMV7
184+ ):
185+ architectures .append ("armv7l" )
186+ elif platform == "windows" and machine_arch == "AMD64" :
187+ architectures .append ("x86" )
188+
189+ wheels : list [str ] = []
190+ for architecture in architectures :
191+ wheels .extend (
192+ _expected_wheels (
193+ package_name ,
194+ package_version ,
195+ architecture ,
196+ manylinux_versions ,
197+ musllinux_versions ,
198+ macosx_deployment_target ,
199+ python_abi_tags ,
200+ include_universal2 ,
201+ single_python ,
202+ )
203+ )
204+ return wheels
205+
206+
207+ def _expected_wheels (
208+ package_name : str ,
209+ package_version : str ,
210+ machine_arch : str ,
211+ manylinux_versions : list [str ] | None ,
212+ musllinux_versions : list [str ] | None ,
213+ macosx_deployment_target : str ,
214+ python_abi_tags : list [str ] | None ,
215+ include_universal2 : bool ,
216+ single_python : bool ,
166217) -> list [str ]:
167218 """
168219 Returns a list of expected wheels from a run of cibuildwheel.
@@ -172,24 +223,12 @@ def expected_wheels(
172223 # {python tag} and {abi tag} are closely related to the python interpreter used to build the wheel
173224 # so we'll merge them below as python_abi_tag
174225
175- if machine_arch is None :
176- machine_arch = pm .machine ()
177- if platform == "linux" and machine_arch .lower () == "arm64" :
178- # we're running linux tests from macOS/Windows arm64, override platform
179- machine_arch = "aarch64"
180-
181226 if manylinux_versions is None :
182- if machine_arch in ("armv7l" , "aarch64" ):
183- manylinux_versions = ["manylinux_2_17" , "manylinux2014" , "manylinux_2_31" ]
184- elif machine_arch == "x86_64" :
185- manylinux_versions = [
186- "manylinux_2_5" ,
187- "manylinux1" ,
188- "manylinux_2_17" ,
189- "manylinux2014" ,
190- ]
191- else :
192- manylinux_versions = ["manylinux_2_17" , "manylinux2014" ]
227+ manylinux_versions = {
228+ "armv7l" : ["manylinux_2_17" , "manylinux2014" , "manylinux_2_31" ],
229+ "i686" : ["manylinux_2_5" , "manylinux1" , "manylinux_2_17" , "manylinux2014" ],
230+ "x86_64" : ["manylinux_2_5" , "manylinux1" , "manylinux_2_28" ],
231+ }.get (machine_arch , ["manylinux_2_17" , "manylinux2014" , "manylinux_2_28" ])
193232
194233 if musllinux_versions is None :
195234 musllinux_versions = ["musllinux_1_2" ]
@@ -207,30 +246,14 @@ def expected_wheels(
207246 "cp313-cp313t" ,
208247 ]
209248
210- if machine_arch in ["x86_64" , "AMD64 " , "x86 " , "aarch64" ]:
249+ if machine_arch in ["x86_64" , "i686 " , "AMD64 " , "aarch64" , "arm64 " ]:
211250 python_abi_tags += [
212251 "pp38-pypy38_pp73" ,
213252 "pp39-pypy39_pp73" ,
214253 "pp310-pypy310_pp73" ,
215254 "pp311-pypy311_pp73" ,
216255 ]
217256
218- if platform == "macos" and machine_arch == "arm64" :
219- # arm64 macs are only supported by cp38+
220- python_abi_tags = [
221- "cp38-cp38" ,
222- "cp39-cp39" ,
223- "cp310-cp310" ,
224- "cp311-cp311" ,
225- "cp312-cp312" ,
226- "cp313-cp313" ,
227- "cp313-cp313t" ,
228- "pp38-pypy38_pp73" ,
229- "pp39-pypy39_pp73" ,
230- "pp310-pypy310_pp73" ,
231- "pp311-pypy311_pp73" ,
232- ]
233-
234257 if single_python :
235258 python_tag = "cp{}{}-" .format (* SINGLE_PYTHON_VERSION )
236259 python_abi_tags = [
@@ -253,44 +276,23 @@ def expected_wheels(
253276 platform_tags = []
254277
255278 if platform == "linux" :
256- architectures = [arch_name_for_linux (machine_arch )]
257-
258- if not single_arch :
259- if machine_arch == "x86_64" :
260- architectures .append ("i686" )
261- elif (
262- machine_arch == "aarch64"
263- and sys .platform .startswith ("linux" )
264- and not python_abi_tag .startswith ("pp" )
265- and _AARCH64_CAN_RUN_ARMV7
266- ):
267- architectures .append ("armv7l" )
268-
269279 if len (manylinux_versions ) > 0 :
270280 platform_tags = [
271281 "." .join (
272- f"{ manylinux_version } _{ architecture } "
282+ f"{ manylinux_version } _{ machine_arch } "
273283 for manylinux_version in manylinux_versions
274- if (manylinux_version , architecture ) != ("manylinux_2_31" , "aarch64" )
275284 )
276- for architecture in architectures
277285 ]
278286 if len (musllinux_versions ) > 0 and not python_abi_tag .startswith ("pp" ):
279- platform_tags .extend (
280- [
281- "." .join (
282- f"{ musllinux_version } _{ architecture } "
283- for musllinux_version in musllinux_versions
284- )
285- for architecture in architectures
286- ]
287+ platform_tags .append (
288+ "." .join (
289+ f"{ musllinux_version } _{ machine_arch } "
290+ for musllinux_version in musllinux_versions
291+ )
287292 )
288293
289294 elif platform == "windows" :
290- if python_abi_tag .startswith ("pp" ):
291- platform_tags = ["win_amd64" ]
292- else :
293- platform_tags = ["win32" , "win_amd64" ]
295+ platform_tags = ["win_amd64" ] if machine_arch == "AMD64" else ["win32" ]
294296
295297 elif platform == "macos" :
296298 if python_abi_tag .startswith ("pp" ):
0 commit comments