Skip to content

Commit c779eab

Browse files
committed
add can_use_uv on macOS
1 parent fbb7ed2 commit c779eab

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cibuildwheel/macos.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,20 +193,23 @@ def install_pypy(tmp: Path, url: str) -> Path:
193193
return installation_path / "bin" / "pypy3"
194194

195195

196+
def can_use_uv(python_configuration: PythonConfiguration) -> bool:
197+
conditions = (Version(python_configuration.version) >= Version("3.8"),)
198+
return all(conditions)
199+
200+
196201
def setup_python(
197202
tmp: Path,
198203
python_configuration: PythonConfiguration,
199204
dependency_constraint_flags: Sequence[PathOrStr],
200205
environment: ParsedEnvironment,
201206
build_frontend: BuildFrontendName,
202207
) -> 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):
204209
build_frontend = "build"
205210

206211
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]"
210213

211214
tmp.mkdir()
212215
implementation_id = python_configuration.identifier.split("-")[0]
@@ -415,9 +418,7 @@ def build(options: Options, tmp_path: Path) -> None:
415418
for config in python_configurations:
416419
build_options = options.build_options(config.identifier)
417420
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)
421422
uv_path = find_uv()
422423
if use_uv and uv_path is None:
423424
msg = "uv not found"

0 commit comments

Comments
 (0)