mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 10:33:49 +00:00
Add pypi 10k packages with most dependents dataset (#711)
From manual inspection, this dataset generated through the [libraries.io API](https://libraries.io/api#project-search) seems more mainstream than the current 8k one, which is also preserved. I've added the dataset to the repo because the API requires an API key.
This commit is contained in:
parent
5bce699ee1
commit
e23292641f
11 changed files with 315 additions and 23 deletions
|
@ -41,13 +41,29 @@ impl<'a> RegistryWheelIndex<'a> {
|
|||
&mut self,
|
||||
name: &PackageName,
|
||||
) -> impl Iterator<Item = (&Version, &CachedRegistryDist)> {
|
||||
self.get_impl(name).iter().rev()
|
||||
}
|
||||
|
||||
/// Get the best wheel for the given package name and version.
|
||||
///
|
||||
/// If the package is not yet indexed, this will index the package by reading from the cache.
|
||||
pub fn get_version(
|
||||
&mut self,
|
||||
name: &PackageName,
|
||||
version: &Version,
|
||||
) -> Option<&CachedRegistryDist> {
|
||||
self.get_impl(name).get(version)
|
||||
}
|
||||
|
||||
/// Get an entry in the index.
|
||||
fn get_impl(&mut self, name: &PackageName) -> &BTreeMap<Version, CachedRegistryDist> {
|
||||
let versions = match self.index.entry(name.clone()) {
|
||||
Entry::Occupied(entry) => entry.into_mut(),
|
||||
Entry::Vacant(entry) => {
|
||||
entry.insert(Self::index(name, self.cache, self.tags, self.index_urls))
|
||||
}
|
||||
};
|
||||
versions.iter().rev()
|
||||
versions
|
||||
}
|
||||
|
||||
/// Add a package to the index by reading from the cache.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue