mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-31 15:57:26 +00:00
Update uv python install --reinstall
to reinstall all previous versions (#11072)
Since we're shipping substantive updates to Python versions frequently, I want to lower the bar for reinstalling with the latest distributions. There's a follow-up task that's documented in a test case at https://github.com/astral-sh/uv/pull/11072/files#diff-f499c776e1d8cc5e55d7620786e32e8732b675abd98e246c0971130f5de9ed50R157-R158
This commit is contained in:
parent
d517b1ca26
commit
586bab32b9
3 changed files with 164 additions and 23 deletions
|
@ -28,6 +28,7 @@ use crate::implementation::{
|
|||
};
|
||||
use crate::installation::PythonInstallationKey;
|
||||
use crate::libc::LibcDetectionError;
|
||||
use crate::managed::ManagedPythonInstallation;
|
||||
use crate::platform::{self, Arch, Libc, Os};
|
||||
use crate::{Interpreter, PythonRequest, PythonVersion, VersionRequest};
|
||||
|
||||
|
@ -344,6 +345,23 @@ impl PythonDownloadRequest {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<&ManagedPythonInstallation> for PythonDownloadRequest {
|
||||
fn from(installation: &ManagedPythonInstallation) -> Self {
|
||||
let key = installation.key();
|
||||
Self::new(
|
||||
Some(VersionRequest::from(&key.version())),
|
||||
match &key.implementation {
|
||||
LenientImplementationName::Known(implementation) => Some(*implementation),
|
||||
LenientImplementationName::Unknown(name) => unreachable!("Managed Python installations are expected to always have known implementation names, found {name}"),
|
||||
},
|
||||
Some(key.arch),
|
||||
Some(key.os),
|
||||
Some(key.libc),
|
||||
Some(key.prerelease.is_some()),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for PythonDownloadRequest {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
let mut parts = Vec::new();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue