Add uv tool install --force (#4501)

Adds detection of existing entry points, avoiding clobbering entry
points that were installed by another tool. If we see any existing entry
point collisions, we'll stop instead of overwriting them. The `--force`
flag can be used to opt-in to overwriting the files; we can't use `-f`
because it's taken by `--find-links` which is silly. The `--force` flag
also implies replacing a tool previously installed by uv (the
environment is rebuilt).

Similarly, #4504 adds support for reinstalls that _will not_ clobber
entry points managed by other tools.
This commit is contained in:
Zanie Blue 2024-06-26 16:03:01 -04:00 committed by GitHub
parent dc408146ac
commit 747ab0d9f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 205 additions and 24 deletions

View file

@ -1912,6 +1912,12 @@ pub struct ToolInstallArgs {
#[command(flatten)]
pub refresh: RefreshArgs,
/// Force installation of the tool.
///
/// Will replace any existing entry points with the same name in the executable directory.
#[arg(long)]
pub force: bool,
/// The Python interpreter to use to build the tool environment.
///
/// By default, uv will search for a Python executable in the `PATH`. uv ignores virtual