mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-04 09:40:39 +00:00
Deduplicate when install or uninstall python (#4841)
When specifying the same argument multiple times, the same version will be downloaded multiple times: ```sh $ cargo run -- python install --preview --force 3.12.3 cpython-3.12 3.12.3 3.12 Looking for installation Python 3.12.3 (any-3.12.3-any-any-any) Looking for installation cpython-3.12-any-any-any (cpython-3.12-any-any-any) Looking for installation Python 3.12.3 (any-3.12.3-any-any-any) Looking for installation Python 3.12 (any-3.12-any-any-any) Found 4/4 versions requiring installation Downloading cpython-3.12.3-windows-x86_64-none Downloading cpython-3.12.3-windows-x86_64-none Downloading cpython-3.12.3-windows-x86_64-none Downloading cpython-3.12.3-windows-x86_64-none ``` This PR deduplicates the `ManagedPythonDownload` before `install` or `uninstall`: ```sh $ cargo run -q -- python install --preview --force 3.12.3 cpython-3.12 3.12.3 3.12 Looking for installation Python 3.12 (any-3.12-any-any-any) Looking for installation Python 3.12.3 (any-3.12.3-any-any-any) Looking for installation cpython-3.12-any-any-any (cpython-3.12-any-any-any) Downloading cpython-3.12.3-windows-x86_64-none Installed Python 3.12.3 to C:\Users\nigel\AppData\Roaming\uv\data\python\cpython-3.12.3-windows-x86_64-none Installed 1 version in 6s $ cargo run -q -- python uninstall --preview 3.12.3 cpython-3.12 3.12.3 3.12 Looking for Python installations matching Python 3.12 (any-3.12-any-any-any) Found installation `cpython-3.12.3-windows-x86_64-none` that matches Python 3.12 Looking for Python installations matching Python 3.12.3 (any-3.12.3-any-any-any) Looking for Python installations matching cpython-3.12-any-any-any (cpython-3.12-any-any-any) Uninstalled `cpython-3.12.3-windows-x86_64-none` Removed 1 Python installation ```
This commit is contained in:
parent
1bd73a7346
commit
bcb2568f47
6 changed files with 24 additions and 18 deletions
|
@ -13,13 +13,13 @@ pub enum Error {
|
|||
UnknownLibc(String),
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy)]
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
|
||||
pub struct Arch(pub(crate) target_lexicon::Architecture);
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy)]
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
|
||||
pub struct Os(pub(crate) target_lexicon::OperatingSystem);
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy)]
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
|
||||
pub enum Libc {
|
||||
Some(target_lexicon::Environment),
|
||||
None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue