@@ -151,64 +151,29 @@ def docker_warmup_fixture(
151
151
return None
152
152
153
153
154
- PLATFORM = get_platform ()
155
- UV_PATH = find_uv ()
156
-
157
- BUILD_FRONTEND_PARAMS = [
158
- pytest .param (
159
- "build[uv]" ,
160
- marks = [
161
- pytest .mark .skipif (
162
- PLATFORM == "pyodide" ,
163
- reason = "Can't use uv with pyodide yet" ,
164
- ),
165
- pytest .mark .skipif (
166
- UV_PATH is None ,
167
- reason = "Can't find uv, so skipping uv tests" ,
168
- ),
169
- ],
170
- id = "build[uv]" ,
171
- ),
172
- pytest .param (
173
- "build" ,
174
- marks = pytest .mark .skipif (
175
- UV_PATH is not None and PLATFORM not in {"android" , "ios" },
176
- reason = "No need to check build when build[uv] is checked (faster)" ,
177
- ),
178
- id = "build" ,
179
- ),
180
- pytest .param (
181
- "pip" ,
182
- marks = pytest .mark .skipif (
183
- PLATFORM in {"pyodide" , "ios" , "android" },
184
- reason = f"Can't use pip as build frontend for { PLATFORM } " ,
185
- ),
186
- id = "pip" ,
187
- ),
188
- ]
189
-
190
-
191
- @pytest .fixture (
192
- params = [
193
- pytest .param (
194
- "pip" ,
195
- marks = pytest .mark .skipif (
196
- PLATFORM in {"pyodide" , "ios" , "android" },
197
- reason = f"Can't use pip as build frontend for { PLATFORM } " ,
198
- ),
199
- ),
200
- "build" ,
201
- ]
202
- )
154
+ @pytest .fixture (params = ["pip" , "build" ])
203
155
def build_frontend_env_nouv (request : pytest .FixtureRequest ) -> dict [str , str ]:
204
156
frontend = request .param
157
+ if get_platform () == "pyodide" and frontend == "pip" :
158
+ pytest .skip ("Can't use pip as build frontend for pyodide platform" )
159
+
205
160
return {"CIBW_BUILD_FRONTEND" : frontend }
206
161
207
162
208
- @pytest .fixture (params = BUILD_FRONTEND_PARAMS )
163
+ @pytest .fixture (params = [ "pip" , "build" , "build[uv]" ] )
209
164
def build_frontend_env (request : pytest .FixtureRequest ) -> dict [str , str ]:
210
- print (f"{ PLATFORM = } " )
211
165
frontend = request .param
166
+ platform = get_platform ()
167
+ if platform in {"pyodide" , "ios" , "android" } and frontend == "pip" :
168
+ pytest .skip ("Can't use pip as build frontend for pyodide/ios/android platform" )
169
+ if platform == "pyodide" and frontend == "build[uv]" :
170
+ pytest .skip ("Can't use uv with pyodide yet" )
171
+ uv_path = find_uv ()
172
+ if uv_path is None and frontend == "build[uv]" :
173
+ pytest .skip ("Can't find uv, so skipping uv tests" )
174
+ if uv_path is not None and frontend == "build" and platform not in {"android" , "ios" }:
175
+ pytest .skip ("No need to check build when uv is present" )
176
+
212
177
return {"CIBW_BUILD_FRONTEND" : frontend }
213
178
214
179
0 commit comments