Skip to content

Commit fbb7ed2

Browse files
committed
fix: do not use uv to setup python on windows when conditions are not met
1 parent 79b0dd3 commit fbb7ed2

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

cibuildwheel/windows.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@ def setup_rust_cross_compile(
225225
)
226226

227227

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+
228236
def setup_python(
229237
tmp: Path,
230238
python_configuration: PythonConfiguration,
@@ -254,11 +262,10 @@ def setup_python(
254262
raise ValueError(msg)
255263
assert base_python.exists()
256264

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]"
262269
uv_path = find_uv()
263270

264271
log.step("Setting up build environment...")
@@ -368,11 +375,7 @@ def build(options: Options, tmp_path: Path) -> None:
368375
for config in python_configurations:
369376
build_options = options.build_options(config.identifier)
370377
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)
376379
log.build_start(config.identifier)
377380

378381
identifier_tmp_dir = tmp_path / config.identifier

0 commit comments

Comments
 (0)