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