Skip to content

Commit e7f6731

Browse files
committed
refactor: drop listify
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 93d88e8 commit e7f6731

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

test/utils.py

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44
This file is added to the PYTHONPATH in the test runner at bin/run_test.py.
55
"""
66

7-
import functools
87
import os
98
import platform as pm
109
import subprocess
1110
import sys
12-
from collections.abc import Callable, Generator, Mapping, Sequence
11+
from collections.abc import Generator, Mapping, Sequence
1312
from pathlib import Path
1413
from tempfile import TemporaryDirectory
15-
from typing import Any, Final, ParamSpec, TypeVar
14+
from typing import Any, Final
1615

1716
import pytest
1817

@@ -153,19 +152,6 @@ def _floor_macosx(*args: str) -> str:
153152
return max(args, key=lambda x: tuple(map(int, x.split("."))))
154153

155154

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
169155
def expected_wheels(
170156
package_name: str,
171157
package_version: str,
@@ -177,7 +163,7 @@ def expected_wheels(
177163
include_universal2: bool = False,
178164
single_python: bool = False,
179165
single_arch: bool = False,
180-
) -> Generator[str, None, None]:
166+
) -> list[str]:
181167
"""
182168
Returns the expected wheels from a run of cibuildwheel.
183169
"""
@@ -200,8 +186,10 @@ def expected_wheels(
200186
elif platform == "windows" and machine_arch == "AMD64":
201187
architectures.append("x86")
202188

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(
205193
package_name,
206194
package_version,
207195
architecture,
@@ -212,6 +200,7 @@ def expected_wheels(
212200
include_universal2,
213201
single_python,
214202
)
203+
]
215204

216205

217206
def _expected_wheels(

0 commit comments

Comments
 (0)