@@ -193,20 +193,23 @@ def install_pypy(tmp: Path, url: str) -> Path:
193
193
return installation_path / "bin" / "pypy3"
194
194
195
195
196
+ def can_use_uv (python_configuration : PythonConfiguration ) -> bool :
197
+ conditions = (Version (python_configuration .version ) >= Version ("3.8" ),)
198
+ return all (conditions )
199
+
200
+
196
201
def setup_python (
197
202
tmp : Path ,
198
203
python_configuration : PythonConfiguration ,
199
204
dependency_constraint_flags : Sequence [PathOrStr ],
200
205
environment : ParsedEnvironment ,
201
206
build_frontend : BuildFrontendName ,
202
207
) -> tuple [Path , dict [str , str ]]:
203
- if build_frontend == "build[uv]" and Version ( python_configuration . version ) < Version ( "3.8" ):
208
+ if build_frontend == "build[uv]" and not can_use_uv ( python_configuration ):
204
209
build_frontend = "build"
205
210
206
211
uv_path = find_uv ()
207
- use_uv = build_frontend == "build[uv]" and Version (python_configuration .version ) >= Version (
208
- "3.8"
209
- )
212
+ use_uv = build_frontend == "build[uv]"
210
213
211
214
tmp .mkdir ()
212
215
implementation_id = python_configuration .identifier .split ("-" )[0 ]
@@ -415,9 +418,7 @@ def build(options: Options, tmp_path: Path) -> None:
415
418
for config in python_configurations :
416
419
build_options = options .build_options (config .identifier )
417
420
build_frontend = build_options .build_frontend or BuildFrontendConfig ("pip" )
418
- use_uv = build_frontend .name == "build[uv]" and Version (config .version ) >= Version (
419
- "3.8"
420
- )
421
+ use_uv = build_frontend .name == "build[uv]" and can_use_uv (config )
421
422
uv_path = find_uv ()
422
423
if use_uv and uv_path is None :
423
424
msg = "uv not found"
0 commit comments