mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-29 03:02:55 +00:00
Rename to uv (#1302)
First, replace all usages in files in-place. I used my editor for this. If someone wants to add a one-liner that'd be fun. Then, update directory and file names: ``` # Run twice for nested directories find . -type d -print0 | xargs -0 rename s/puffin/uv/g find . -type d -print0 | xargs -0 rename s/puffin/uv/g # Update files find . -type f -print0 | xargs -0 rename s/puffin/uv/g ``` Then add all the files again ``` # Add all the files again git add crates git add python/uv # This one needs a force-add git add -f crates/uv-trampoline ```
This commit is contained in:
parent
328b116d5d
commit
2586f655bb
229 changed files with 1796 additions and 1818 deletions
45
crates/uv-resolver/src/resolution_mode.rs
Normal file
45
crates/uv-resolver/src/resolution_mode.rs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
use rustc_hash::FxHashSet;
|
||||
|
||||
use pep508_rs::Requirement;
|
||||
use uv_normalize::PackageName;
|
||||
|
||||
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
|
||||
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
|
||||
pub enum ResolutionMode {
|
||||
/// Resolve the highest compatible version of each package.
|
||||
#[default]
|
||||
Highest,
|
||||
/// Resolve the lowest compatible version of each package.
|
||||
Lowest,
|
||||
/// Resolve the lowest compatible version of any direct dependencies, and the highest
|
||||
/// compatible version of any transitive dependencies.
|
||||
LowestDirect,
|
||||
}
|
||||
|
||||
/// Like [`ResolutionMode`], but with any additional information required to select a candidate,
|
||||
/// like the set of direct dependencies.
|
||||
#[derive(Debug, Clone)]
|
||||
pub(crate) enum ResolutionStrategy {
|
||||
/// Resolve the highest compatible version of each package.
|
||||
Highest,
|
||||
/// Resolve the lowest compatible version of each package.
|
||||
Lowest,
|
||||
/// Resolve the lowest compatible version of any direct dependencies, and the highest
|
||||
/// compatible version of any transitive dependencies.
|
||||
LowestDirect(FxHashSet<PackageName>),
|
||||
}
|
||||
|
||||
impl ResolutionStrategy {
|
||||
pub(crate) fn from_mode(mode: ResolutionMode, direct_dependencies: &[Requirement]) -> Self {
|
||||
match mode {
|
||||
ResolutionMode::Highest => Self::Highest,
|
||||
ResolutionMode::Lowest => Self::Lowest,
|
||||
ResolutionMode::LowestDirect => Self::LowestDirect(
|
||||
direct_dependencies
|
||||
.iter()
|
||||
.map(|requirement| requirement.name.clone())
|
||||
.collect(),
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue