@@ -225,6 +225,14 @@ def setup_rust_cross_compile(
225
225
)
226
226
227
227
228
+ def can_use_uv (python_configuration : PythonConfiguration ) -> bool :
229
+ conditions = (
230
+ Version (python_configuration .version ) >= Version ("3.8" ),
231
+ not python_configuration .identifier .startswith ("pp38-" ),
232
+ )
233
+ return all (conditions )
234
+
235
+
228
236
def setup_python (
229
237
tmp : Path ,
230
238
python_configuration : PythonConfiguration ,
@@ -254,11 +262,10 @@ def setup_python(
254
262
raise ValueError (msg )
255
263
assert base_python .exists ()
256
264
257
- use_uv = (
258
- build_frontend == "build[uv]"
259
- and Version (python_configuration .version ) >= Version ("3.8" )
260
- and not python_configuration .identifier .startswith ("pp38-" )
261
- )
265
+ if build_frontend == "build[uv]" and not can_use_uv (python_configuration ):
266
+ build_frontend = "build"
267
+
268
+ use_uv = build_frontend == "build[uv]"
262
269
uv_path = find_uv ()
263
270
264
271
log .step ("Setting up build environment..." )
@@ -368,11 +375,7 @@ def build(options: Options, tmp_path: Path) -> None:
368
375
for config in python_configurations :
369
376
build_options = options .build_options (config .identifier )
370
377
build_frontend = build_options .build_frontend or BuildFrontendConfig ("pip" )
371
- use_uv = (
372
- build_frontend .name == "build[uv]"
373
- and Version (config .version ) >= Version ("3.8" )
374
- and not config .identifier .startswith ("pp38-" )
375
- )
378
+ use_uv = build_frontend .name == "build[uv]" and can_use_uv (config )
376
379
log .build_start (config .identifier )
377
380
378
381
identifier_tmp_dir = tmp_path / config .identifier
0 commit comments