4
4
This file is added to the PYTHONPATH in the test runner at bin/run_test.py.
5
5
"""
6
6
7
- import functools
8
7
import os
9
8
import platform as pm
10
9
import subprocess
11
10
import sys
12
- from collections .abc import Callable , Generator , Mapping , Sequence
11
+ from collections .abc import Generator , Mapping , Sequence
13
12
from pathlib import Path
14
13
from tempfile import TemporaryDirectory
15
- from typing import Any , Final , ParamSpec , TypeVar
14
+ from typing import Any , Final
16
15
17
16
import pytest
18
17
@@ -153,19 +152,6 @@ def _floor_macosx(*args: str) -> str:
153
152
return max (args , key = lambda x : tuple (map (int , x .split ("." ))))
154
153
155
154
156
- P = ParamSpec ("P" )
157
- R = TypeVar ("R" )
158
-
159
-
160
- def _listify (func : Callable [P , Generator [R , None , None ]]) -> Callable [P , list [R ]]:
161
- @functools .wraps (func )
162
- def listify_return (* args : P .args , ** kwargs : P .kwargs ) -> list [R ]:
163
- return list (func (* args , ** kwargs ))
164
-
165
- return listify_return
166
-
167
-
168
- @_listify
169
155
def expected_wheels (
170
156
package_name : str ,
171
157
package_version : str ,
@@ -177,7 +163,7 @@ def expected_wheels(
177
163
include_universal2 : bool = False ,
178
164
single_python : bool = False ,
179
165
single_arch : bool = False ,
180
- ) -> Generator [str , None , None ]:
166
+ ) -> list [str ]:
181
167
"""
182
168
Returns the expected wheels from a run of cibuildwheel.
183
169
"""
@@ -200,8 +186,10 @@ def expected_wheels(
200
186
elif platform == "windows" and machine_arch == "AMD64" :
201
187
architectures .append ("x86" )
202
188
203
- for architecture in architectures :
204
- yield from _expected_wheels (
189
+ return [
190
+ wheel
191
+ for architecture in architectures
192
+ for wheel in _expected_wheels (
205
193
package_name ,
206
194
package_version ,
207
195
architecture ,
@@ -212,6 +200,7 @@ def expected_wheels(
212
200
include_universal2 ,
213
201
single_python ,
214
202
)
203
+ ]
215
204
216
205
217
206
def _expected_wheels (
0 commit comments