mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Respect .python-version
files and fetch manged toolchains in uv project commands (#4361)
As in #4360, updates the uv project CLI to respect `.python-version` files as default Python version requests. Additionally, updates project interpreter discovery to fetch managed toolchains as in `uv venv --preview`.
This commit is contained in:
parent
903dfc2f1f
commit
1ce21475a5
11 changed files with 120 additions and 51 deletions
|
@ -32,7 +32,7 @@ pub struct BaseClientBuilder<'a> {
|
|||
keyring: KeyringProviderType,
|
||||
native_tls: bool,
|
||||
retries: u32,
|
||||
connectivity: Connectivity,
|
||||
pub connectivity: Connectivity,
|
||||
client: Option<Client>,
|
||||
markers: Option<&'a MarkerEnvironment>,
|
||||
platform: Option<&'a Platform>,
|
||||
|
|
|
@ -929,6 +929,16 @@ pub enum Connectivity {
|
|||
Offline,
|
||||
}
|
||||
|
||||
impl Connectivity {
|
||||
pub fn is_online(&self) -> bool {
|
||||
matches!(self, Self::Online)
|
||||
}
|
||||
|
||||
pub fn is_offline(&self) -> bool {
|
||||
matches!(self, Self::Offline)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::str::FromStr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue