fix: support --no-isolation with build[uv] (#1889)
* fix: support --no-isolation with build[uv] Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * docs: mention caveat Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
@@ -282,7 +282,7 @@ def build_in_container(
|
|||||||
if not 0 <= build_options.build_verbosity < 2:
|
if not 0 <= build_options.build_verbosity < 2:
|
||||||
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
|
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
|
||||||
log.warning(msg)
|
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"]
|
extra_flags += ["--installer=uv"]
|
||||||
container.call(
|
container.call(
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -505,7 +505,7 @@ def build(options: Options, tmp_path: Path) -> None:
|
|||||||
if not 0 <= build_options.build_verbosity < 2:
|
if not 0 <= build_options.build_verbosity < 2:
|
||||||
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
|
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
|
||||||
log.warning(msg)
|
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")
|
extra_flags.append("--installer=uv")
|
||||||
call(
|
call(
|
||||||
"python",
|
"python",
|
||||||
|
|||||||
@@ -441,7 +441,7 @@ def build(options: Options, tmp_path: Path) -> None:
|
|||||||
if not 0 <= build_options.build_verbosity < 2:
|
if not 0 <= build_options.build_verbosity < 2:
|
||||||
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
|
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
|
||||||
log.warning(msg)
|
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")
|
extra_flags.append("--installer=uv")
|
||||||
call(
|
call(
|
||||||
"python",
|
"python",
|
||||||
|
|||||||
@@ -657,6 +657,12 @@ optional `args` option.
|
|||||||
will change the default to [build][], in line with the PyPA's recommendation.
|
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.
|
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/
|
[pip]: https://pip.pypa.io/en/stable/cli/pip_wheel/
|
||||||
[build]: https://github.com/pypa/build/
|
[build]: https://github.com/pypa/build/
|
||||||
[uv]: https://github.com/astral-sh/uv
|
[uv]: https://github.com/astral-sh/uv
|
||||||
|
|||||||
Reference in New Issue
Block a user