uv
a95a8c88 - Remove some Clap-level conflicts in argument groups (#3001)

Commit
1 year ago
Remove some Clap-level conflicts in argument groups (#3001) ## Summary It turns out that if you have an environment variable set, Clap will consider that equivalent to passing the flag, even if it's set to (e.g.) something falsy or the default value. So, e.g., this fails: ```shell UV_SYSTEM=false uv pip install --python ./.venv/bin/python flask ``` Worse, this fails, because it thinks `--no-index` and `--index-url` are conflicting: ```shell export UV_INDEX_URL=https://google.com uv pip install flask --no-index ``` This PR removes some of the conflicts, namely those related to environment variables, such that: - You _can_ pass mixes of `--no-index`, `--index-url`, etc. If `--no-index` is provided, all the index URLs will be ignored (but we won't error). - Passing `--pre` will always enable prereleases, even if `--prerelease` is also provided. (We could warn here, although honestly it's not trivial because we'd need to make `--prerelease` take an optional, then we'd lose the default argument from the `--help`.) - You _can_ pass `--system` and `--python`. If `--python` is provided, we use that, and ignore `--system`. (We could warn here.) I guess the underlying problem here is that we can't differentiate between arguments passed on the CLI and those set as environment variables. But making bigger changes here seems out-of-scope. Closes https://github.com/astral-sh/uv/issues/3000.
Author
Parents
Loading