uv/crates/uv-cli
Mikayla Thompson 88811553e4
`pip install --target` (and `sync`) install python if necessary (#16694)
## Summary

As described in https://github.com/astral-sh/uv/issues/12229, `pip
install` with `--target` or `--prefix` seem like they should install the
necessary python version if it doesn't exist, but they currently don't.

Most minimal reproduction is something like:
```
> uv python uninstall 3.13
...
> uv pip install anyio --target target-dir --python 3.13
error: No interpreter found for Python 3.13 in virtual environments, managed installations, or search path
```

This also fails without `--target`, but a venv is expected in that case,
so the with `--target`/`--prefix` is the only version that needs to be
fixed. The same mechanism occurs for `uv pip sync` as well.

## Test Plan

Added tests for install and sync that failed before fix and now pass.

---------

Signed-off-by: Mikayla Thompson <mrt@mikayla.codes>
2025-11-12 15:42:52 -07:00
..
src `pip install --target` (and `sync`) install python if necessary (#16694) 2025-11-12 15:42:52 -07:00
Cargo.toml Add a plain text backend for credential storage (#15588) 2025-09-02 13:16:52 -05:00
build.rs Fix commits_since_last_tag in version info (#9730) 2024-12-09 09:43:27 -06:00