Skip to content

Commit 973946b

Browse files
authored
fix: support --no-isolation with build[uv] (#1889)
* fix: support --no-isolation with build[uv] Signed-off-by: Henry Schreiner <[email protected]> * docs: mention caveat Signed-off-by: Henry Schreiner <[email protected]> --------- Signed-off-by: Henry Schreiner <[email protected]>
1 parent 5ea40e6 commit 973946b

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

cibuildwheel/linux.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def build_in_container(
282282
if not 0 <= build_options.build_verbosity < 2:
283283
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
284284
log.warning(msg)
285-
if use_uv:
285+
if use_uv and "--no-isolation" not in extra_flags and "-n" not in extra_flags:
286286
extra_flags += ["--installer=uv"]
287287
container.call(
288288
[

cibuildwheel/macos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ def build(options: Options, tmp_path: Path) -> None:
505505
if not 0 <= build_options.build_verbosity < 2:
506506
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
507507
log.warning(msg)
508-
if use_uv:
508+
if use_uv and "--no-isolation" not in extra_flags and "-n" not in extra_flags:
509509
extra_flags.append("--installer=uv")
510510
call(
511511
"python",

cibuildwheel/windows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def build(options: Options, tmp_path: Path) -> None:
441441
if not 0 <= build_options.build_verbosity < 2:
442442
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
443443
log.warning(msg)
444-
if use_uv:
444+
if use_uv and "--no-isolation" not in extra_flags and "-n" not in extra_flags:
445445
extra_flags.append("--installer=uv")
446446
call(
447447
"python",

docs/options.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,12 @@ optional `args` option.
657657
will change the default to [build][], in line with the PyPA's recommendation.
658658
If you want to try `build` before this, you can use this option.
659659

660+
!!! warning
661+
If you are using `build[uv]` and are passing `--no-isolation` or `-n`, we
662+
will detect this and avoid passing `--installer=uv` to build, but still
663+
install all packages with uv. We do not currently detect combined short
664+
options, like `-xn`!
665+
660666
[pip]: https://pip.pypa.io/en/stable/cli/pip_wheel/
661667
[build]: https://github.com/pypa/build/
662668
[uv]: https://github.com/astral-sh/uv

0 commit comments

Comments
 (0)