uv/crates/uv-cli/src
Zanie Blue 61fcdfb2e4 Allow `-p` to use complex Python version requests in `uv pip compile` (#11486)
Closes #11285
Closes https://github.com/astral-sh/uv/pull/11437

This changes `-p` from an alias of `--python-version` to `--python`
while retaining backwards compatibility for `--python-version`-like
fallback behavior when the requested version, e.g., `-p 3.12`, cannot be
found.

This was initially implemented with a hidden `--python-legacy` flag
which allows us to special case the short `-p` flag — unlike the
implementation in #11437. However, after further discussion, we decided
the behavior difference between `-p` and `--python` would be confusing
so now `-p` is an alias for `--python` and `--python` is special-cased
when a version is used.

Additionally, we now respect the `UV_PYTHON` environment variable, but
it is ignored when `--python-version` is set. If you want different
`--python-version` and `--python` values, you must do so explicitly. I
considered banning this, but it is valid for e.g. `--python pypy
--python-version 3.12`
2025-02-13 16:17:49 -06:00
..
comma.rs Remove trailing commas before brackets (#10740) 2025-01-18 19:56:46 +00:00
compat.rs Add support for `pip list --outdated` (#8872) 2024-11-07 02:32:30 +00:00
lib.rs Allow `-p` to use complex Python version requests in `uv pip compile` (#11486) 2025-02-13 16:17:49 -06:00
options.rs Introduce a `--fork-strategy` preference mode (#9868) 2024-12-13 16:05:07 -05:00
version.rs Remove separate test files in favor of same-file `mod tests` (#9199) 2024-11-18 20:11:46 +00:00