Skip to content

Commit b277c36

Browse files
authored
fix: bump rattler (#4953)
1 parent 2960369 commit b277c36

32 files changed

+441
-252
lines changed

Cargo.lock

Lines changed: 25 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,22 +117,22 @@ pypi_mapping = { path = "crates/pypi_mapping" }
117117
pypi_modifiers = { path = "crates/pypi_modifiers" }
118118
pyproject-toml = "0.13.7"
119119
rand = { version = "0.9.1", default-features = false }
120-
rattler = { version = "0.38.4", default-features = false }
121-
rattler_cache = { version = "0.4.1", default-features = false }
122-
rattler_conda_types = { version = "0.40.4", default-features = false, features = [
120+
rattler = { version = "0.39.1", default-features = false }
121+
rattler_cache = { version = "0.6.0", default-features = false }
122+
rattler_conda_types = { version = "0.41.1", default-features = false, features = [
123123
"rayon",
124124
] }
125-
rattler_digest = { version = "1.1.7", default-features = false }
125+
rattler_digest = { version = "1.2.0", default-features = false }
126126
rattler_lock = { version = "0.26.1", default-features = false }
127127
rattler_menuinst = { version = "0.2.23", default-features = false }
128128
rattler_networking = { version = "0.25.21", default-features = false, features = [
129129
"dirs",
130130
"google-cloud-auth",
131131
] }
132132
rattler_package_streaming = { version = "0.23.13", default-features = false }
133-
rattler_repodata_gateway = { version = "0.24.14", default-features = false }
133+
rattler_repodata_gateway = { version = "0.25.1", default-features = false }
134134
rattler_shell = { version = "0.25.7", default-features = false }
135-
rattler_solve = { version = "3.0.9", default-features = false }
135+
rattler_solve = { version = "3.1.1", default-features = false }
136136
rattler_virtual_packages = { version = "2.2.5", default-features = false }
137137
rayon = "1.10.0"
138138
regex = "1.11.1"

crates/pixi_api/src/workspace/search/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ pub async fn search_exact<I: Interface>(
5353
miette::miette!("could not find package name in MatchSpec {}", match_spec)
5454
})?;
5555

56+
let package_name = package_name_search
57+
.as_exact()
58+
.ok_or_else(|| miette::miette!("search does not support wildcard package names"))?;
59+
5660
let packages = search_package_by_filter(
57-
&package_name_search,
61+
package_name,
5862
all_package_names,
5963
repodata_query_func,
6064
|pn, n| pn == n,
@@ -63,7 +67,7 @@ pub async fn search_exact<I: Interface>(
6367
.await?;
6468

6569
if packages.is_empty() {
66-
let normalized_package_name = package_name_search.as_normalized();
70+
let normalized_package_name = package_name.as_normalized();
6771
return Err(miette::miette!(
6872
"Package {normalized_package_name} not found, please use a wildcard '*' in the search name for a broader result."
6973
));

crates/pixi_cli/src/exec.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ pub async fn create_exec_prefix(
264264
let guessed_package_name = specs[specs.len() - 1]
265265
.name
266266
.as_ref()
267-
.map(|name| name.as_source())
267+
.and_then(|name| name.as_exact().map(|n| n.as_source()))
268268
.unwrap_or("<unknown>");
269269
tracing::debug!(
270270
"Solver failed with guessed package '{}', retrying without it: {}",
@@ -335,7 +335,7 @@ fn list_exec_environment(
335335
specs
336336
.clone()
337337
.into_iter()
338-
.filter_map(|spec| spec.name) // Extract the name if it exists
338+
.filter_map(|spec| spec.name.and_then(|n| n.as_exact().cloned())) // Extract exact name if it exists
339339
.collect_vec()
340340
.contains(&record.package_record.name),
341341
)
@@ -374,7 +374,11 @@ fn guess_package_spec(command: &str) -> MatchSpec {
374374
);
375375

376376
MatchSpec {
377-
name: Some(PackageName::from_str(&command).expect("all illegal characters were removed")),
377+
name: Some(
378+
PackageName::from_str(&command)
379+
.expect("all illegal characters were removed")
380+
.into(),
381+
),
378382
..Default::default()
379383
}
380384
}

crates/pixi_cli/src/global/global_specs.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,14 @@ impl GlobalSpecs {
178178
self.specs
179179
.iter()
180180
.map(|spec_str| {
181-
MatchSpec::from_str(spec_str, ParseStrictness::Lenient)?
181+
let name = MatchSpec::from_str(spec_str, ParseStrictness::Lenient)?
182182
.name
183-
.ok_or(GlobalSpecsConversionError::NameRequired)
184-
.map(|name| pixi_global::project::GlobalSpec::new(name, pixi_spec.clone()))
183+
.and_then(|matcher| matcher.as_exact().cloned())
184+
.ok_or(GlobalSpecsConversionError::NameRequired)?;
185+
Ok(pixi_global::project::GlobalSpec::new(
186+
name,
187+
pixi_spec.clone(),
188+
))
185189
})
186190
.collect()
187191
} else {

crates/pixi_cli/src/global/install.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,13 @@ async fn sync_exposed_names(
279279
.with
280280
.iter()
281281
.map(|spec| {
282-
spec.name
283-
.clone()
284-
.ok_or_else(|| miette::miette!("could not find package name in MatchSpec {}", spec))
282+
let name_matcher = spec.name.clone().ok_or_else(|| {
283+
miette::miette!("could not find package name in MatchSpec {}", spec)
284+
})?;
285+
name_matcher
286+
.as_exact()
287+
.cloned()
288+
.ok_or_else(|| miette::miette!("wildcard package names are not supported"))
285289
})
286290
.collect::<miette::Result<Vec<_>>>()?;
287291
let expose_type = if args.expose.is_empty().not() {

crates/pixi_cli/src/global/remove.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ pub async fn execute(args: Args) -> miette::Result<()> {
6262
// Remove specs from the manifest
6363
let mut removed_dependencies = vec![];
6464
for spec in specs {
65-
let package_name = spec.name.as_ref().expect("package name should be present");
65+
let package_name = spec
66+
.name
67+
.as_ref()
68+
.expect("package name should be present")
69+
.as_exact()
70+
.expect("package name must be exact");
6671
project
6772
.manifest
6873
.remove_dependency(env_name, package_name)
@@ -73,9 +78,10 @@ pub async fn execute(args: Args) -> miette::Result<()> {
7378
let prefix = project.environment_prefix(env_name).await?;
7479

7580
for spec in specs {
76-
if let Some(name) = spec.clone().name {
81+
if let Some(name_matcher) = spec.clone().name {
82+
let name = name_matcher.as_exact().expect("package name must be exact");
7783
// If the package is not existent, don't try to remove executables
78-
if let Ok(record) = prefix.find_designated_package(&name).await {
84+
if let Ok(record) = prefix.find_designated_package(name).await {
7985
prefix
8086
.find_executables(&[record])
8187
.into_iter()

crates/pixi_cli/src/has_specs.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ pub(crate) trait HasSpecs {
1616
.map(|package| {
1717
let spec =
1818
MatchSpec::from_str(package, ParseStrictness::Lenient).into_diagnostic()?;
19-
let name = spec.name.clone().ok_or_else(|| {
19+
let name_matcher = spec.name.clone().ok_or_else(|| {
2020
miette::miette!("could not find package name in MatchSpec {}", spec)
2121
})?;
22+
let name = name_matcher
23+
.as_exact()
24+
.cloned()
25+
.ok_or_else(|| miette::miette!("wildcard package names are not supported"))?;
2226
Ok((name, spec))
2327
})
2428
.collect()

crates/pixi_cli/src/match_spec_or_path.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ impl MatchSpecOrPath {
3333
Self::MatchSpec(spec) => spec
3434
.name
3535
.as_ref()
36-
.map(|name| name.as_normalized().to_string()),
36+
.and_then(|name| name.as_exact())
37+
.map(|n| n.as_normalized().to_string()),
3738
Self::Path(path_spec) => path_spec
3839
.path
3940
.file_name()
@@ -72,7 +73,7 @@ impl FromStr for MatchSpecOrPath {
7273
.map_err(|e| format!("invalid package name: {e}"))?;
7374

7475
return Ok(Self::MatchSpec(Box::new(MatchSpec {
75-
name: Some(name),
76+
name: Some(name.into()),
7677
url: Some(url),
7778
..MatchSpec::default()
7879
})));
@@ -163,7 +164,7 @@ fn path_spec_to_match_spec(path_spec: PathSpec) -> Result<MatchSpec, String> {
163164
PackageName::try_from(archive.name).map_err(|e| format!("invalid package name: {e}"))?;
164165

165166
Ok(MatchSpec {
166-
name: Some(name),
167+
name: Some(name.into()),
167168
url: Some(url),
168169
..MatchSpec::default()
169170
})
@@ -193,7 +194,10 @@ mod tests {
193194
match spec_or_path {
194195
MatchSpecOrPath::MatchSpec(spec) => {
195196
assert_eq!(
196-
spec.name.as_ref().map(|n| n.as_normalized()),
197+
spec.name
198+
.as_ref()
199+
.and_then(|n| n.as_exact())
200+
.map(|e| e.as_normalized()),
197201
Some("tzdata")
198202
);
199203
assert!(spec.url.is_some());
@@ -210,7 +214,10 @@ mod tests {
210214
match spec_or_path {
211215
MatchSpecOrPath::MatchSpec(spec) => {
212216
assert_eq!(
213-
spec.name.as_ref().map(|n| n.as_normalized()),
217+
spec.name
218+
.as_ref()
219+
.and_then(|n| n.as_exact())
220+
.map(|e| e.as_normalized()),
214221
Some("test-package")
215222
);
216223
assert!(spec.url.is_some());

crates/pixi_cli/src/upgrade.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ pub fn parse_specs_for_platform(
428428
Some((
429429
name.clone(),
430430
(
431-
MatchSpec::from_nameless(nameless_match_spec, Some(name)),
431+
MatchSpec::from_nameless(nameless_match_spec, Some(name.clone().into())),
432432
spec_type,
433433
),
434434
))

0 commit comments

Comments
 (0)