mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-03 05:03:46 +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
28
crates/uv-resolver/src/pins.rs
Normal file
28
crates/uv-resolver/src/pins.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
use rustc_hash::FxHashMap;
|
||||
|
||||
use distribution_types::{CompatibleDist, Dist};
|
||||
use uv_normalize::PackageName;
|
||||
|
||||
use crate::candidate_selector::Candidate;
|
||||
|
||||
/// A set of package versions pinned to specific files.
|
||||
///
|
||||
/// For example, given `Flask==3.0.0`, the [`FilePins`] would contain a mapping from `Flask` to
|
||||
/// `3.0.0` to the specific wheel or source distribution archive that was pinned for that version.
|
||||
#[derive(Debug, Default)]
|
||||
pub(crate) struct FilePins(FxHashMap<PackageName, FxHashMap<pep440_rs::Version, Dist>>);
|
||||
|
||||
impl FilePins {
|
||||
/// Pin a candidate package.
|
||||
pub(crate) fn insert(&mut self, candidate: &Candidate, dist: &CompatibleDist) {
|
||||
self.0.entry(candidate.name().clone()).or_default().insert(
|
||||
candidate.version().clone(),
|
||||
dist.for_installation().dist.clone(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Return the pinned file for the given package name and version, if it exists.
|
||||
pub(crate) fn get(&self, name: &PackageName, version: &pep440_rs::Version) -> Option<&Dist> {
|
||||
self.0.get(name)?.get(version)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue