Skip to content

Commit

Permalink
feat: upgrade to new uv 0.2.37 (#1829)
Browse files Browse the repository at this point in the history
Co-authored-by: Ruben Arts <ruben.arts@hotmail.com>
  • Loading branch information
tdejager and ruben-arts authored Aug 20, 2024
1 parent b21f3ae commit b41104a
Show file tree
Hide file tree
Showing 42 changed files with 688 additions and 482 deletions.
392 changes: 271 additions & 121 deletions Cargo.lock

Large diffs are not rendered by default.

76 changes: 34 additions & 42 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ csv = "1.3.0"
deno_task_shell = "0.16.0"
dialoguer = "0.11.0"
dirs = "5.0.1"
distribution-filename = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
distribution-types = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
distribution-filename = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
distribution-types = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
dunce = "1.0.4"
fd-lock = "4.0.2"
flate2 = "1.0.28"
Expand All @@ -40,7 +40,7 @@ ignore = "0.4.22"
indexmap = "2.2.6"
indicatif = "0.17.8"
insta = "1.38.0"
install-wheel-rs = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
install-wheel-rs = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
is_executable = "1.0.1"
itertools = "0.13.0"
lazy_static = "1.4.0"
Expand All @@ -53,11 +53,11 @@ parking_lot = "0.12.2"
pep440_rs = "0.6.0"
pep508_rs = "0.6.0"
percent-encoding = "2.3.1"
platform-tags = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
pypi-types = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
platform-tags = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
pypi-types = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
pyproject-toml = "0.11.0"
regex = "1.10.4"
requirements-txt = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
requirements-txt = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
reqwest = { version = "0.12.4", default-features = false }
reqwest-middleware = "0.3.0"
reqwest-retry = "0.5.0"
Expand Down Expand Up @@ -100,19 +100,19 @@ rattler_virtual_packages = { version = "1.0.4", default-features = false }

# Bumping this to a higher version breaks the Windows path handling.
url = "2.5.0"
uv-auth = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
uv-cache = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
uv-client = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
uv-configuration = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
uv-dispatch = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
uv-distribution = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
uv-git = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
uv-installer = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
uv-normalize = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
uv-requirements = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
uv-resolver = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
uv-toolchain = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
uv-types = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
uv-auth = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
uv-cache = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
uv-client = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
uv-configuration = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
uv-dispatch = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
uv-distribution = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
uv-git = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
uv-installer = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
uv-normalize = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
uv-python = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
uv-requirements = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
uv-resolver = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
uv-types = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
winapi = { version = "0.3.9", default-features = false }
xxhash-rust = "0.8.10"
zip = { version = "0.6.6", default-features = false }
Expand Down Expand Up @@ -277,8 +277,8 @@ uv-distribution = { workspace = true }
uv-git = { workspace = true }
uv-installer = { workspace = true }
uv-normalize = { workspace = true }
uv-python = { workspace = true }
uv-resolver = { workspace = true }
uv-toolchain = { workspace = true }
uv-types = { workspace = true }
xxhash-rust = { workspace = true }
zip = { workspace = true, features = ["deflate", "time"] }
Expand All @@ -289,17 +289,6 @@ nix = { workspace = true, features = ["fs", "signal", "term", "poll"] }
pixi_pty = { path = "crates/pixi_pty" }
signal-hook = { workspace = true }

# Remove this after updating to uv >= 0.1.40
[target.'cfg(windows)'.dependencies]
winapi = { workspace = true, features = [
"fileapi",
"handleapi",
"ioapiset",
"winbase",
"winioctl",
"winnt",
] }

[profile.dist]
codegen-units = 1
inherits = "release"
Expand All @@ -326,18 +315,19 @@ tokio = { workspace = true, features = ["rt"] }
# For pyproject-toml
# pyproject-toml = { git = "https://github.com/tdejager/pyproject-toml-rs", branch = "feat/bump-508-440" }
# If you change this also change the versions in the the patch section for uv
pep440_rs = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
pep508_rs = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
pep440_rs = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
pep508_rs = { git = "https://github.com/astral-sh/uv", tag = "0.2.37" }
reqwest-middleware = { git = "https://github.com/astral-sh/reqwest-middleware", rev = "21ceec9a5fd2e8d6f71c3ea2999078fecbd13cbe" }
# deno_task_shell = { path = "../deno_task_shell" }
#rattler = { git = "https://github.com/mamba-org/rattler", branch = "main" }
#rattler_conda_types = { git = "https://github.com/mamba-org/rattler", branch = "main" }
#rattler_digest = { git = "https://github.com/mamba-org/rattler", branch = "main" }
#rattler_lock = { git = "https://github.com/mamba-org/rattler", branch = "main" }
#rattler_networking = { git = "https://github.com/mamba-org/rattler", branch = "main" }
#rattler_repodata_gateway = { git = "https://github.com/mamba-org/rattler", branch = "main" }
#rattler_shell = { git = "https://github.com/mamba-org/rattler", branch = "main" }
#rattler_solve = { git = "https://github.com/mamba-org/rattler", branch = "main" }
#rattler_virtual_packages = { git = "https://github.com/mamba-org/rattler", branch = "main" }
# rattler = { git = "https://github.com/tdejager/rattler", branch = "feat/default-marker-tree" }
# rattler_conda_types = { git = "https://github.com/tdejager/rattler", branch = "feat/default-marker-tree" }
# rattler_digest = { git = "https://github.com/tdejager/rattler", branch = "feat/default-marker-tree" }
# rattler_lock = { git = "https://github.com/tdejager/rattler", branch = "feat/default-marker-tree" }
# rattler_networking = { git = "https://github.com/tdejager/rattler", branch = "feat/default-marker-tree" }
# rattler_repodata_gateway = { git = "https://github.com/tdejager/rattler", branch = "feat/default-marker-tree" }
# rattler_shell = { git = "https://github.com/tdejager/rattler", branch = "feat/default-marker-tree" }
# rattler_solve = { git = "https://github.com/tdejager/rattler", branch = "feat/default-marker-tree" }
# rattler_virtual_packages = { git = "https://github.com/tdejager/rattler", branch = "feat/default-marker-tree" }
#rattler_conda_types = { path = "../rattler/crates/rattler_conda_types" }
#rattler_digest = { path = "../rattler/crates/rattler_digest" }
#rattler_networking = { path = "../rattler/crates/rattler_networking" }
Expand All @@ -348,6 +338,8 @@ pep508_rs = { git = "https://github.com/astral-sh/uv", tag = "0.2.18" }
#rattler_lock = { path = "../rattler/crates/rattler_lock" }
#rattler_package_streaming = { path = "../rattler/crates/rattler_package_streaming" }
#rattler = { path = "../rattler/crates/rattler" }


# Change these lines if you want a patched version of uv
# [patch.'https://github.com/astral-sh/uv']
# pep440_rs = { git = "https://github.com/astral-sh/uv", rev = "65b17f6e81125064ea04c5cfef685516ab660cf5" }
Expand Down
7 changes: 7 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This lint does not follow raw pointers (*const T or *mut T) as Hash and Ord apply only to the address of the contained value.
# This can cause false negatives for custom collections that use raw pointers internally.
# See https://rust-lang.github.io/rust-clippy/master/index.html#/mutable_key_type
ignore-interior-mutability = [
"pixi::project::environment::Environment",
"pixi::project::solve_group::SolveGroup",
]
4 changes: 2 additions & 2 deletions crates/pixi_config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ impl From<ConfigCliPrompt> for Config {
#[cfg(feature = "rattler_repodata_gateway")]
impl From<Config> for rattler_repodata_gateway::ChannelConfig {
fn from(config: Config) -> Self {
config.into()
rattler_repodata_gateway::ChannelConfig::from(&config)
}
}

Expand Down Expand Up @@ -968,7 +968,7 @@ UNUSED = "unused"
config.detached_environments().path().unwrap(),
Some(PathBuf::from(env!("CARGO_MANIFEST_DIR")))
);
assert!(unused.contains(&"UNUSED".to_string()));
assert!(unused.contains("UNUSED"));

let toml = r"detached-environments = true";
let (config, _) = Config::from_toml(toml).unwrap();
Expand Down
12 changes: 6 additions & 6 deletions crates/pixi_manifest/src/dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ impl<N: Hash + Eq + Clone, D: Hash + Eq + Clone> Dependencies<N, D> {
}

/// Removes a specific dependency
pub fn remove<Q: ?Sized>(&mut self, name: &Q) -> Option<(N, IndexSet<D>)>
pub fn remove<Q>(&mut self, name: &Q) -> Option<(N, IndexSet<D>)>
where
Q: Hash + Equivalent<N>,
Q: ?Sized + Hash + Equivalent<N>,
{
self.map.shift_remove_entry(name)
}
Expand Down Expand Up @@ -129,17 +129,17 @@ impl<N: Hash + Eq + Clone, D: Hash + Eq + Clone> Dependencies<N, D> {
}

/// Returns true if the dependency list contains the given package name.
pub fn contains_key<Q: ?Sized>(&self, name: &Q) -> bool
pub fn contains_key<Q>(&self, name: &Q) -> bool
where
Q: Hash + Equivalent<N>,
Q: ?Sized + Hash + Equivalent<N>,
{
self.map.contains_key(name)
}

/// Returns the package specs for the specified package name.
pub fn get<Q: ?Sized>(&self, name: &Q) -> Option<&IndexSet<D>>
pub fn get<Q>(&self, name: &Q) -> Option<&IndexSet<D>>
where
Q: Hash + Equivalent<N>,
Q: ?Sized + Hash + Equivalent<N>,
{
self.map.get(name)
}
Expand Down
4 changes: 2 additions & 2 deletions crates/pixi_manifest/src/environments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ pub struct Environments {
impl Environments {
/// Returns the environment with the given name or `None` if it does not
/// exist.
pub fn find<Q: ?Sized>(&self, name: &Q) -> Option<&Environment>
pub fn find<Q>(&self, name: &Q) -> Option<&Environment>
where
Q: Hash + Equivalent<EnvironmentName>,
Q: ?Sized + Hash + Equivalent<EnvironmentName>,
{
let index = self.by_name.get(name)?;
self.environments[index.0].as_ref()
Expand Down
12 changes: 6 additions & 6 deletions crates/pixi_manifest/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,9 @@ impl Manifest {

/// Returns the mutable feature with the given name or `None` if it does not
/// exist.
pub fn feature_mut<Q: ?Sized>(&mut self, name: &Q) -> miette::Result<&mut Feature>
pub fn feature_mut<Q>(&mut self, name: &Q) -> miette::Result<&mut Feature>
where
Q: Hash + Equivalent<FeatureName> + Display,
Q: ?Sized + Hash + Equivalent<FeatureName> + Display,
{
self.parsed
.features
Expand All @@ -613,9 +613,9 @@ impl Manifest {
}

/// Returns the feature with the given name or `None` if it does not exist.
pub fn feature<Q: ?Sized>(&self, name: &Q) -> Option<&Feature>
pub fn feature<Q>(&self, name: &Q) -> Option<&Feature>
where
Q: Hash + Equivalent<FeatureName>,
Q: ?Sized + Hash + Equivalent<FeatureName>,
{
self.parsed.features.get(name)
}
Expand All @@ -631,9 +631,9 @@ impl Manifest {

/// Returns the environment with the given name or `None` if it does not
/// exist.
pub fn environment<Q: ?Sized>(&self, name: &Q) -> Option<&Environment>
pub fn environment<Q>(&self, name: &Q) -> Option<&Environment>
where
Q: Hash + Equivalent<EnvironmentName>,
Q: ?Sized + Hash + Equivalent<EnvironmentName>,
{
self.parsed.environments.find(name)
}
Expand Down
4 changes: 2 additions & 2 deletions crates/pixi_manifest/src/parsed_manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ impl ParsedManifest {

/// Returns the environment with the given name or `None` if it does not
/// exist.
pub fn environment<Q: ?Sized>(&self, name: &Q) -> Option<&Environment>
pub fn environment<Q>(&self, name: &Q) -> Option<&Environment>
where
Q: Hash + Equivalent<EnvironmentName>,
Q: ?Sized + Hash + Equivalent<EnvironmentName>,
{
self.environments.find(name)
}
Expand Down
4 changes: 2 additions & 2 deletions crates/pixi_manifest/src/solve_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ pub struct SolveGroupIdx(pub(crate) usize);
impl SolveGroups {
/// Returns the solve group with the given name or `None` if it does not
/// exist.
pub fn find<Q: ?Sized>(&self, name: &Q) -> Option<&SolveGroup>
pub fn find<Q>(&self, name: &Q) -> Option<&SolveGroup>
where
Q: Hash + Equivalent<String>,
Q: ?Sized + Hash + Equivalent<String>,
{
let index = self.by_name.get(name)?;
Some(&self.solve_groups[index.0])
Expand Down
14 changes: 7 additions & 7 deletions crates/pixi_manifest/src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,14 @@ impl TargetSelector {
}
}

impl ToString for TargetSelector {
fn to_string(&self) -> String {
impl std::fmt::Display for TargetSelector {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
TargetSelector::Platform(p) => p.to_string(),
TargetSelector::Linux => "linux".to_string(),
TargetSelector::Unix => "unix".to_string(),
TargetSelector::Win => "win".to_string(),
TargetSelector::MacOs => "osx".to_string(),
TargetSelector::Platform(p) => write!(f, "{}", p),
TargetSelector::Linux => write!(f, "linux"),
TargetSelector::Unix => write!(f, "unix"),
TargetSelector::Win => write!(f, "win"),
TargetSelector::MacOs => write!(f, "osx"),
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ expression: "(parse_dependencies(env_info.dependencies().clone()).unwrap(),\n
),
extras: [],
version_or_url: None,
marker: None,
marker: true,
origin: None,
},
Requirement {
Expand All @@ -828,7 +828,7 @@ expression: "(parse_dependencies(env_info.dependencies().clone()).unwrap(),\n
),
extras: [],
version_or_url: None,
marker: None,
marker: true,
origin: None,
},
Requirement {
Expand All @@ -837,7 +837,7 @@ expression: "(parse_dependencies(env_info.dependencies().clone()).unwrap(),\n
),
extras: [],
version_or_url: None,
marker: None,
marker: true,
origin: None,
},
Requirement {
Expand All @@ -846,7 +846,7 @@ expression: "(parse_dependencies(env_info.dependencies().clone()).unwrap(),\n
),
extras: [],
version_or_url: None,
marker: None,
marker: true,
origin: None,
},
Requirement {
Expand Down Expand Up @@ -878,7 +878,7 @@ expression: "(parse_dependencies(env_info.dependencies().clone()).unwrap(),\n
},
),
),
marker: None,
marker: true,
origin: None,
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ expression: "(parse_dependencies(env_info.dependencies().clone()).unwrap(),\n
),
),
),
marker: None,
marker: true,
origin: None,
},
Requirement {
Expand All @@ -145,7 +145,7 @@ expression: "(parse_dependencies(env_info.dependencies().clone()).unwrap(),\n
),
extras: [],
version_or_url: None,
marker: None,
marker: true,
origin: None,
},
Requirement {
Expand All @@ -154,7 +154,7 @@ expression: "(parse_dependencies(env_info.dependencies().clone()).unwrap(),\n
),
extras: [],
version_or_url: None,
marker: None,
marker: true,
origin: None,
},
Requirement {
Expand All @@ -163,7 +163,7 @@ expression: "(parse_dependencies(env_info.dependencies().clone()).unwrap(),\n
),
extras: [],
version_or_url: None,
marker: None,
marker: true,
origin: None,
},
Requirement {
Expand All @@ -172,7 +172,7 @@ expression: "(parse_dependencies(env_info.dependencies().clone()).unwrap(),\n
),
extras: [],
version_or_url: None,
marker: None,
marker: true,
origin: None,
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ expression: "(parse_dependencies(env_info.dependencies().clone()).unwrap(),\n
),
extras: [],
version_or_url: None,
marker: None,
marker: true,
origin: None,
},
Requirement {
Expand All @@ -226,7 +226,7 @@ expression: "(parse_dependencies(env_info.dependencies().clone()).unwrap(),\n
),
extras: [],
version_or_url: None,
marker: None,
marker: true,
origin: None,
},
],
Expand Down
Loading

0 comments on commit b41104a

Please sign in to comment.