You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7b5d227
Browse filesBrowse the repository at this point in the historyBrowse files
Let --no-package and --script take precedence over UV_INIT_BUILD_BACKEND (#22907)
## Summary
with `UV_INIT_BUILD_BACKEND` set, `uv init --app --no-package` and `uv
init --script` failed with "the argument '--no-package' cannot be used
with '--build-backend'" even though no `--build-backend` was passed,
since clap applies `conflicts_with` to values from env vars too. since
`uv init` creates a package by default now, `--no-package` is the way to
get the non packaged app from this issue.
`EnvironmentOptions` now parses `UV_INIT_BUILD_BACKEND` alongside the
other typed environment settings. `uv init` uses that default when it
needs a backend. An explicit `--build-backend` takes precedence, and
`--script`, `--no-package`, and `--virtual` ignore a valid default. An
invalid value fails any command that loads environment settings,
including `uv sync`.
this isnt the conflict on `--app` suggested earlier in the thread, with
packaged init as the default that would break valid commands like `uv
init --app --build-backend hatchling`.
Closes#17335
## Test Plan
added `init_application_no_package_build_backend_env`,
`init_script_build_backend_env` and `init_build_backend_env_invalid`.
`init::` tests pass, checked by hand that the env var still sets the
backend for `--app`, `--lib` and `--bare`.
---------
Co-authored-by: Charlie Marsh <[email protected]>
0 commit comments