Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support --no-isolation with build[uv] #1889

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cibuildwheel/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def build_in_container(
if not 0 <= build_options.build_verbosity < 2:
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
log.warning(msg)
if use_uv:
if use_uv and "--no-isolation" not in extra_flags and "-n" not in extra_flags:
extra_flags += ["--installer=uv"]
container.call(
[
Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ def build(options: Options, tmp_path: Path) -> None:
if not 0 <= build_options.build_verbosity < 2:
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
log.warning(msg)
if use_uv:
if use_uv and "--no-isolation" not in extra_flags and "-n" not in extra_flags:
extra_flags.append("--installer=uv")
call(
"python",
Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def build(options: Options, tmp_path: Path) -> None:
if not 0 <= build_options.build_verbosity < 2:
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
log.warning(msg)
if use_uv:
if use_uv and "--no-isolation" not in extra_flags and "-n" not in extra_flags:
extra_flags.append("--installer=uv")
call(
"python",
Expand Down
6 changes: 6 additions & 0 deletions docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,12 @@ optional `args` option.
will change the default to [build][], in line with the PyPA's recommendation.
If you want to try `build` before this, you can use this option.

!!! warning
If you are using `build[uv]` and are passing `--no-isolation` or `-n`, we
will detect this and avoid passing `--installer=uv` to build, but still
install all packages with uv. We do not currently detect combined short
options, like `-xn`!

[pip]: https://pip.pypa.io/en/stable/cli/pip_wheel/
[build]: https:/pypa/build/
[uv]: https:/astral-sh/uv
Expand Down
Loading