mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Update Rust crate rustc-hash to v2 (#4461)
This commit is contained in:
parent
8a0a3b47db
commit
3251690327
9 changed files with 47 additions and 54 deletions
46
Cargo.lock
generated
46
Cargo.lock
generated
|
@ -1831,7 +1831,7 @@ dependencies = [
|
|||
"pypi-types",
|
||||
"reflink-copy",
|
||||
"regex",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
"schemars",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
@ -2574,7 +2574,7 @@ name = "platform-tags"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"insta",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
"serde",
|
||||
"thiserror",
|
||||
]
|
||||
|
@ -2701,7 +2701,7 @@ dependencies = [
|
|||
"indexmap",
|
||||
"log",
|
||||
"priority-queue",
|
||||
"rustc-hash",
|
||||
"rustc-hash 1.1.0",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
|
@ -2715,7 +2715,7 @@ dependencies = [
|
|||
"indoc",
|
||||
"libc",
|
||||
"memoffset 0.9.1",
|
||||
"parking_lot 0.11.2",
|
||||
"parking_lot 0.12.3",
|
||||
"portable-atomic",
|
||||
"pyo3-build-config",
|
||||
"pyo3-ffi",
|
||||
|
@ -2812,7 +2812,7 @@ dependencies = [
|
|||
"pin-project-lite",
|
||||
"quinn-proto",
|
||||
"quinn-udp",
|
||||
"rustc-hash",
|
||||
"rustc-hash 1.1.0",
|
||||
"rustls",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
|
@ -2828,7 +2828,7 @@ dependencies = [
|
|||
"bytes",
|
||||
"rand",
|
||||
"ring",
|
||||
"rustc-hash",
|
||||
"rustc-hash 1.1.0",
|
||||
"rustls",
|
||||
"slab",
|
||||
"thiserror",
|
||||
|
@ -3305,6 +3305,12 @@ version = "1.1.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
||||
|
||||
[[package]]
|
||||
name = "rustc-hash"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152"
|
||||
|
||||
[[package]]
|
||||
name = "rustix"
|
||||
version = "0.38.34"
|
||||
|
@ -4183,7 +4189,7 @@ dependencies = [
|
|||
"fs-err",
|
||||
"itertools 0.12.1",
|
||||
"once_cell",
|
||||
"rustc-hash",
|
||||
"rustc-hash 1.1.0",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"svg",
|
||||
|
@ -4455,7 +4461,7 @@ dependencies = [
|
|||
"rayon",
|
||||
"regex",
|
||||
"reqwest",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"textwrap",
|
||||
|
@ -4527,7 +4533,7 @@ dependencies = [
|
|||
"pep508_rs",
|
||||
"pypi-types",
|
||||
"regex",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tempfile",
|
||||
|
@ -4554,7 +4560,7 @@ dependencies = [
|
|||
"nanoid",
|
||||
"pypi-types",
|
||||
"rmp-serde",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
"serde",
|
||||
"tempfile",
|
||||
"tracing",
|
||||
|
@ -4624,7 +4630,7 @@ dependencies = [
|
|||
"pep508_rs",
|
||||
"platform-tags",
|
||||
"pypi-types",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
"schemars",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
@ -4651,7 +4657,7 @@ dependencies = [
|
|||
"pretty_assertions",
|
||||
"pypi-types",
|
||||
"resvg",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
"schemars",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
@ -4686,7 +4692,7 @@ dependencies = [
|
|||
"install-wheel-rs",
|
||||
"itertools 0.13.0",
|
||||
"pypi-types",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
"tracing",
|
||||
"uv-build",
|
||||
"uv-cache",
|
||||
|
@ -4724,7 +4730,7 @@ dependencies = [
|
|||
"reqwest",
|
||||
"reqwest-middleware",
|
||||
"rmp-serde",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
"schemars",
|
||||
"serde",
|
||||
"tempfile",
|
||||
|
@ -4758,7 +4764,7 @@ dependencies = [
|
|||
"md-5",
|
||||
"pypi-types",
|
||||
"rayon",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
"sha2",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
|
@ -4823,7 +4829,7 @@ dependencies = [
|
|||
"platform-tags",
|
||||
"pypi-types",
|
||||
"rayon",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
"same-file",
|
||||
"serde",
|
||||
"tempfile",
|
||||
|
@ -4879,7 +4885,7 @@ dependencies = [
|
|||
"pep508_rs",
|
||||
"pypi-types",
|
||||
"requirements-txt",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
"serde",
|
||||
"thiserror",
|
||||
"toml",
|
||||
|
@ -4925,7 +4931,7 @@ dependencies = [
|
|||
"pypi-types",
|
||||
"requirements-txt",
|
||||
"rkyv",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
"same-file",
|
||||
"schemars",
|
||||
"serde",
|
||||
|
@ -5035,7 +5041,7 @@ dependencies = [
|
|||
"pep440_rs",
|
||||
"pep508_rs",
|
||||
"pypi-types",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
"thiserror",
|
||||
"url",
|
||||
"uv-cache",
|
||||
|
@ -5072,7 +5078,7 @@ dependencies = [
|
|||
"anstream",
|
||||
"once_cell",
|
||||
"owo-colors",
|
||||
"rustc-hash",
|
||||
"rustc-hash 2.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -114,7 +114,7 @@ reqwest-retry = { version = "0.5.0" }
|
|||
rkyv = { version = "0.7.43", features = ["strict", "validation"] }
|
||||
rmp-serde = { version = "1.1.2" }
|
||||
rust-netrc = { version = "0.1.1" }
|
||||
rustc-hash = { version = "1.1.0" }
|
||||
rustc-hash = { version = "2.0.0" }
|
||||
same-file = { version = "1.0.6" }
|
||||
schemars = { version = "0.8.16", features = ["url"] }
|
||||
seahash = { version = "4.1.0" }
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
use std::hash::BuildHasherDefault;
|
||||
|
||||
use rustc_hash::FxHashMap;
|
||||
use rustc_hash::{FxBuildHasher, FxHashMap};
|
||||
|
||||
use pypi_types::Requirement;
|
||||
use uv_normalize::PackageName;
|
||||
|
@ -13,7 +11,7 @@ impl Constraints {
|
|||
/// Create a new set of constraints from a set of requirements.
|
||||
pub fn from_requirements(requirements: Vec<Requirement>) -> Self {
|
||||
let mut constraints: FxHashMap<PackageName, Vec<Requirement>> =
|
||||
FxHashMap::with_capacity_and_hasher(requirements.len(), BuildHasherDefault::default());
|
||||
FxHashMap::with_capacity_and_hasher(requirements.len(), FxBuildHasher);
|
||||
for requirement in requirements {
|
||||
constraints
|
||||
.entry(requirement.name.clone())
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
use std::hash::BuildHasherDefault;
|
||||
|
||||
use either::Either;
|
||||
use pypi_types::Requirement;
|
||||
use rustc_hash::FxHashMap;
|
||||
use rustc_hash::{FxBuildHasher, FxHashMap};
|
||||
|
||||
use pypi_types::Requirement;
|
||||
use uv_normalize::PackageName;
|
||||
|
||||
/// A set of overrides for a set of requirements.
|
||||
|
@ -14,7 +12,7 @@ impl Overrides {
|
|||
/// Create a new set of overrides from a set of requirements.
|
||||
pub fn from_requirements(requirements: Vec<Requirement>) -> Self {
|
||||
let mut overrides: FxHashMap<PackageName, Vec<Requirement>> =
|
||||
FxHashMap::with_capacity_and_hasher(requirements.len(), BuildHasherDefault::default());
|
||||
FxHashMap::with_capacity_and_hasher(requirements.len(), FxBuildHasher);
|
||||
for requirement in requirements {
|
||||
overrides
|
||||
.entry(requirement.name.clone())
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
use std::collections::hash_map::Entry;
|
||||
use std::hash::BuildHasherDefault;
|
||||
use std::path::Path;
|
||||
use std::str::FromStr;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use rustc_hash::FxHashMap;
|
||||
use rustc_hash::{FxBuildHasher, FxHashMap};
|
||||
use tracing::debug;
|
||||
|
||||
use distribution_filename::WheelFilename;
|
||||
|
@ -71,10 +70,7 @@ impl<'a> Planner<'a> {
|
|||
let mut remote = vec![];
|
||||
let mut reinstalls = vec![];
|
||||
let mut extraneous = vec![];
|
||||
let mut seen = FxHashMap::with_capacity_and_hasher(
|
||||
self.requirements.len(),
|
||||
BuildHasherDefault::default(),
|
||||
);
|
||||
let mut seen = FxHashMap::with_capacity_and_hasher(self.requirements.len(), FxBuildHasher);
|
||||
|
||||
for requirement in self.requirements {
|
||||
// Filter out incompatible requirements.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use std::collections::BTreeSet;
|
||||
use std::iter::Flatten;
|
||||
use std::path::PathBuf;
|
||||
use std::{collections::BTreeSet, hash::BuildHasherDefault};
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
use fs_err as fs;
|
||||
use rustc_hash::{FxHashMap, FxHashSet};
|
||||
use rustc_hash::{FxBuildHasher, FxHashMap, FxHashSet};
|
||||
use url::Url;
|
||||
|
||||
use distribution_types::{
|
||||
|
@ -257,8 +257,7 @@ impl SitePackages {
|
|||
constraints: &[Requirement],
|
||||
) -> Result<SatisfiesResult> {
|
||||
let mut stack = Vec::with_capacity(requirements.len());
|
||||
let mut seen =
|
||||
FxHashSet::with_capacity_and_hasher(requirements.len(), BuildHasherDefault::default());
|
||||
let mut seen = FxHashSet::with_capacity_and_hasher(requirements.len(), FxBuildHasher);
|
||||
|
||||
// Add the direct requirements to the queue.
|
||||
for entry in requirements {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
use std::collections::BTreeSet;
|
||||
use std::hash::BuildHasherDefault;
|
||||
|
||||
use owo_colors::OwoColorize;
|
||||
use petgraph::visit::EdgeRef;
|
||||
use petgraph::Direction;
|
||||
use rustc_hash::FxHashMap;
|
||||
use rustc_hash::{FxBuildHasher, FxHashMap};
|
||||
|
||||
use distribution_types::{Name, SourceAnnotations};
|
||||
use uv_normalize::PackageName;
|
||||
|
@ -93,7 +92,7 @@ impl std::fmt::Display for DisplayResolutionGraph<'_> {
|
|||
);
|
||||
let mut inverse = FxHashMap::with_capacity_and_hasher(
|
||||
self.resolution.petgraph.node_count(),
|
||||
BuildHasherDefault::default(),
|
||||
FxBuildHasher,
|
||||
);
|
||||
|
||||
// Re-add the nodes to the reduced graph.
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
use std::hash::BuildHasherDefault;
|
||||
|
||||
use indexmap::IndexSet;
|
||||
use petgraph::{
|
||||
graph::{Graph, NodeIndex},
|
||||
Directed,
|
||||
};
|
||||
use rustc_hash::{FxHashMap, FxHashSet};
|
||||
use rustc_hash::{FxBuildHasher, FxHashMap};
|
||||
|
||||
use distribution_types::{
|
||||
Dist, DistributionMetadata, Name, ResolutionDiagnostic, VersionId, VersionOrUrlRef,
|
||||
|
@ -56,10 +55,8 @@ impl ResolutionGraph {
|
|||
) -> Result<Self, ResolveError> {
|
||||
let mut petgraph: Graph<AnnotatedDist, Option<MarkerTree>, Directed> =
|
||||
Graph::with_capacity(resolution.packages.len(), resolution.packages.len());
|
||||
let mut inverse: FxHashMap<NodeKey, NodeIndex<u32>> = FxHashMap::with_capacity_and_hasher(
|
||||
resolution.packages.len(),
|
||||
BuildHasherDefault::default(),
|
||||
);
|
||||
let mut inverse: FxHashMap<NodeKey, NodeIndex<u32>> =
|
||||
FxHashMap::with_capacity_and_hasher(resolution.packages.len(), FxBuildHasher);
|
||||
let mut diagnostics = Vec::new();
|
||||
|
||||
// Add every package to the graph.
|
||||
|
@ -348,7 +345,7 @@ impl ResolutionGraph {
|
|||
}
|
||||
|
||||
/// Add all marker parameters from the given tree to the given set.
|
||||
fn add_marker_params_from_tree(marker_tree: &MarkerTree, set: &mut FxHashSet<MarkerParam>) {
|
||||
fn add_marker_params_from_tree(marker_tree: &MarkerTree, set: &mut IndexSet<MarkerParam>) {
|
||||
match marker_tree {
|
||||
MarkerTree::Expression(
|
||||
MarkerExpression::Version { key, .. }
|
||||
|
@ -378,7 +375,7 @@ impl ResolutionGraph {
|
|||
}
|
||||
}
|
||||
|
||||
let mut seen_marker_values = FxHashSet::default();
|
||||
let mut seen_marker_values = IndexSet::default();
|
||||
for i in self.petgraph.node_indices() {
|
||||
let dist = &self.petgraph[i];
|
||||
let version_id = match dist.version_or_url() {
|
||||
|
|
|
@ -7821,7 +7821,7 @@ fn emit_marker_expression_exciting_linux() -> Result<()> {
|
|||
# This file was autogenerated by uv via the following command:
|
||||
# uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2024-03-25T00:00:00Z requirements.in --emit-marker-expression
|
||||
# Pinned dependencies known to be valid for:
|
||||
# platform_system == 'Linux' and python_version == '3.12' and platform_python_implementation == 'CPython'
|
||||
# python_version == '3.12' and platform_python_implementation == 'CPython' and platform_system == 'Linux'
|
||||
anyio==4.3.0
|
||||
# via -r requirements.in
|
||||
idna==3.6
|
||||
|
@ -7858,7 +7858,7 @@ fn emit_marker_expression_direct() -> Result<()> {
|
|||
# This file was autogenerated by uv via the following command:
|
||||
# uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2024-03-25T00:00:00Z requirements.in --emit-marker-expression
|
||||
# Pinned dependencies known to be valid for:
|
||||
# python_version == '3.12' and platform_python_implementation == 'CPython' and sys_platform == 'linux' and platform_system == 'Linux'
|
||||
# python_version == '3.12' and platform_python_implementation == 'CPython' and platform_system == 'Linux' and sys_platform == 'linux'
|
||||
anyio==4.3.0
|
||||
# via -r requirements.in
|
||||
idna==3.6
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue