Skip to content

Commit

Permalink
chore: update rattler and remove archspec for now (prefix-dev#1103)
Browse files Browse the repository at this point in the history
Co-authored-by: Bas Zalmstra <[email protected]>
Co-authored-by: Ruben Arts <[email protected]>
  • Loading branch information
3 people authored Apr 4, 2024
1 parent 2d70705 commit a0fb574
Show file tree
Hide file tree
Showing 13 changed files with 497 additions and 406 deletions.
374 changes: 205 additions & 169 deletions Cargo.lock

Large diffs are not rendered by default.

59 changes: 29 additions & 30 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ slow_integration_tests = []
assert_matches = "1.5.0"
async-once-cell = "0.5.3"
cfg-if = "1.0"
chrono = "0.4.35"
clap = { version = "4.5.3", default-features = false, features = [
chrono = "0.4.37"
clap = { version = "4.5.4", default-features = false, features = [
"derive",
"usage",
"wrap_help",
Expand All @@ -42,7 +42,7 @@ clap-verbosity-flag = "2.2.0"
clap_complete = "4.5.1"
console = { version = "0.15.8", features = ["windows-console-colors"] }
crossbeam-channel = "0.5.12"
deno_task_shell = "0.14.4"
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.1.24" }
Expand All @@ -54,7 +54,7 @@ http-cache-reqwest = "0.13.0"
human_bytes = "0.4.3"
humantime = "2.1.0"
ignore = "0.4.22"
indexmap = { version = "2.2.5", features = ["serde"] }
indexmap = { version = "2.2.6", features = ["serde"] }
indicatif = "0.17.8"

install-wheel-rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.24" }
Expand All @@ -69,55 +69,55 @@ miette = { version = "7.2.0", features = [
"terminal_size",
"textwrap",
] }
minijinja = { version = "1.0.14", features = ["builtins"] }
minijinja = { version = "1.0.16", features = ["builtins"] }
once_cell = "1.19.0"
pep440_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.24" }
pep508_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.24" }
platform-tags = { git = "https://github.com/astral-sh/uv", tag = "0.1.24" }
pypi-types = { git = "https://github.com/astral-sh/uv", tag = "0.1.24" }
pyproject-toml = "0.10.0"
rattler = { version = "0.19.4", default-features = false, features = [
rattler = { version = "0.20.0", default-features = false, features = [
"cli-tools",
] }
rattler_conda_types = { version = "0.20.3", default-features = false }
rattler_conda_types = { version = "0.20.4", default-features = false }
rattler_digest = { version = "0.19.2", default-features = false }
rattler_lock = { version = "0.21.0", default-features = false }
rattler_lock = { version = "0.22.0", default-features = false }
rattler_networking = { version = "0.20.0", default-features = false }
rattler_repodata_gateway = { version = "0.19.4", default-features = false, features = [
rattler_repodata_gateway = { version = "0.19.5", default-features = false, features = [
"sparse",
] }
rattler_shell = { version = "0.19.4", default-features = false, features = [
rattler_shell = { version = "0.19.5", default-features = false, features = [
"sysinfo",
] }
rattler_solve = { version = "0.20.3", default-features = false, features = [
rattler_solve = { version = "0.20.4", default-features = false, features = [
"resolvo",
] }
rattler_virtual_packages = { version = "0.19.4", default-features = false }
regex = "1.10.3"
rattler_virtual_packages = { version = "0.19.5", default-features = false }
regex = "1.10.4"
requirements-txt = { git = "https://github.com/astral-sh/uv", tag = "0.1.24" }
reqwest = { version = "0.11.27", default-features = false }
reqwest-middleware = "0.2.5"
reqwest-retry = "0.4.0"
self-replace = "1.3.7"
serde = "1.0.197"
serde-untagged = "0.1.5"
serde_json = "1.0.114"
serde_json = "1.0.115"
serde_with = { version = "3.7.0", features = ["indexmap"] }
serde_yaml = "0.9.33"
serde_yaml = "0.9.34"
shlex = "1.3.0"
spdx = "0.10.4"
strsim = "0.11.0"
tabwriter = { version = "1.4.0", features = ["ansi_formatting"] }
tar = "0.4.40"
tempfile = "3.10.1"
thiserror = "1.0.58"
tokio = { version = "1.36.0", features = [
tokio = { version = "1.37.0", features = [
"macros",
"rt-multi-thread",
"signal",
] }
tokio-util = "0.7.10"
toml_edit = { version = "0.22.8", features = ["serde"] }
toml_edit = { version = "0.22.9", features = ["serde"] }
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
url = "2.5.0"
Expand Down Expand Up @@ -148,30 +148,29 @@ libc = { version = "0.2.153", default-features = false }
signal-hook = "0.3.17"

[dev-dependencies]
insta = { version = "1.36.1", features = ["yaml", "glob"] }
insta = { version = "1.38.0", features = ["yaml", "glob"] }
rattler_digest = "0.19.2"
rstest = "0.18.2"
serde_json = "1.0.114"
serde_json = "1.0.115"
serial_test = "3.0.0"
tokio = { version = "1.36.0", features = ["rt"] }
tokio = { version = "1.37.0", features = ["rt"] }
toml = "0.8.12"

[patch.crates-io]
# For pyproject-toml
# 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.1.24" }
pep508_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.24" }

# deno_task_shell = { path = "../deno_task_shell" }
rattler = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
rattler_conda_types = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
rattler_digest = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
rattler_lock = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
rattler_networking = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
rattler_repodata_gateway = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
rattler_shell = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
rattler_solve = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
rattler_virtual_packages = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
# rattler = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
# rattler_conda_types = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
# rattler_digest = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
# rattler_lock = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
# rattler_networking = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
# rattler_repodata_gateway = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
# rattler_shell = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
# rattler_solve = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
# rattler_virtual_packages = { git = "https://github.com/baszalmstra/rattler", rev = "b6ccac0f72df9617d6d02220595ed4595aa34e1c" }
#rattler_conda_types = { path = "../rattler/crates/rattler_conda_types" }
#rattler_digest = { path = "../rattler/crates/rattler_digest" }
#rattler_networking = { path = "../rattler/crates/rattler_networking" }
Expand Down
1 change: 1 addition & 0 deletions src/lock_file/satisfiability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ pub fn verify_package_platform_satisfiability(
let virtual_packages = environment
.virtual_packages(platform)
.into_iter()
.map(GenericVirtualPackage::from)
.map(|vpkg| (vpkg.name.clone(), vpkg))
.collect::<HashMap<_, _>>();

Expand Down
43 changes: 5 additions & 38 deletions src/project/manifest/system_requirements.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use miette::Diagnostic;
use rattler_conda_types::Version;
use rattler_virtual_packages::{Archspec, Cuda, LibC, Linux, Osx, VirtualPackage};
use rattler_virtual_packages::{Cuda, LibC, Linux, Osx, VirtualPackage};
use serde::Deserialize;
use serde_with::{serde_as, DisplayFromStr};
use std::str::FromStr;
Expand Down Expand Up @@ -44,13 +44,12 @@ impl SystemRequirements {
if let Some(version) = self.macos.clone() {
result.push(VirtualPackage::Osx(Osx { version }))
}
if let Some(spec) = self.archspec.clone() {
result.push(VirtualPackage::Archspec(Archspec { spec }))
}
if let Some(libc) = self.libc.clone() {
result.push(VirtualPackage::LibC(libc.into()))
}

if let Some(_archspec) = self.archspec.clone() {
tracing::info!("The archspec system-requirement is deprecated and not used.");
}
result
}

Expand Down Expand Up @@ -223,7 +222,7 @@ mod tests {
use assert_matches::assert_matches;
use insta::assert_snapshot;
use rattler_conda_types::Version;
use rattler_virtual_packages::{Archspec, Cuda, LibC, Linux, Osx, VirtualPackage};
use rattler_virtual_packages::{Cuda, LibC, Linux, Osx, VirtualPackage};
use serde::Deserialize;
use std::str::FromStr;

Expand All @@ -233,7 +232,6 @@ mod tests {
linux = "5.11"
cuda = "12.2"
macos = "10.15"
archspec = "arm64"
libc = { family = "glibc", version = "2.12" }
"#;

Expand All @@ -250,9 +248,6 @@ mod tests {
VirtualPackage::Osx(Osx {
version: Version::from_str("10.15").unwrap(),
}),
VirtualPackage::Archspec(Archspec {
spec: "arm64".to_string(),
}),
VirtualPackage::LibC(LibC {
version: Version::from_str("2.12").unwrap(),
family: "glibc".to_string(),
Expand Down Expand Up @@ -476,32 +471,4 @@ mod tests {

assert_matches!(eglibc_2_17.union(&glibc_2_12).unwrap_err(), SystemRequirementsUnionError::DifferentLibcFamilies(fam_a, fam_b) if fam_a == "eglibc" && fam_b == "glibc");
}

#[test]
fn test_union_archspec() {
let a = SystemRequirements {
archspec: Some("arm64".to_string()),
..Default::default()
};
let b = SystemRequirements {
archspec: Some("x86_64".to_string()),
..Default::default()
};
let c = SystemRequirements {
archspec: None,
..Default::default()
};
assert_matches!(
a.union(&b).unwrap_err(),
SystemRequirementsUnionError::MismatchingArchSpec(a,b) if a == "arm64" && b == "x86_64"
);
assert_eq!(
c.union(&b).unwrap(),
SystemRequirements {
archspec: Some("x86_64".to_string()),
..Default::default()
}
);
assert_eq!(c.union(&b).unwrap(), b.union(&c).unwrap());
}
}
5 changes: 3 additions & 2 deletions src/project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ use distribution_types::IndexLocations;
use indexmap::{Equivalent, IndexMap, IndexSet};
use miette::{IntoDiagnostic, NamedSource};

use rattler_conda_types::{Channel, GenericVirtualPackage, Platform, Version};
use rattler_conda_types::{Channel, Platform, Version};
use reqwest_middleware::ClientWithMiddleware;
use std::fs;
use std::hash::Hash;

use rattler_virtual_packages::VirtualPackage;
use std::{
collections::{HashMap, HashSet},
env,
Expand Down Expand Up @@ -371,7 +372,7 @@ impl Project {
}

/// TODO: Remove this method and use the one from Environment instead.
pub fn virtual_packages(&self, platform: Platform) -> Vec<GenericVirtualPackage> {
pub fn virtual_packages(&self, platform: Platform) -> Vec<VirtualPackage> {
self.default_environment().virtual_packages(platform)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,51 @@
---
source: src/project/virtual_packages.rs
assertion_line: 226
expression: packages
---
[
Unix,
Linux(
Linux {
version: Version {
version: [[0], [5], [10]],
local: [],
},
},
),
LibC(
LibC {
family: "glibc",
version: Version {
version: [[0], [2], [17]],
local: [],
},
},
),
Archspec(
Archspec {
spec: "x86_64",
},
),
GenericVirtualPackage {
name: PackageName {
normalized: None,
source: "__unix",
},
version: Version {
version: [[0], [0]],
local: [],
},
build_string: "0",
},
GenericVirtualPackage {
name: PackageName {
normalized: None,
source: "__linux",
},
version: Version {
version: [[0], [5], [10]],
local: [],
},
build_string: "0",
},
GenericVirtualPackage {
name: PackageName {
normalized: None,
source: "__glibc",
},
version: Version {
version: [[0], [2], [17]],
local: [],
},
build_string: "0",
},
GenericVirtualPackage {
name: PackageName {
normalized: None,
source: "__archspec",
},
version: Version {
version: [[0], [1]],
local: [],
},
build_string: "x86_64",
},
]
Loading

0 comments on commit a0fb574

Please sign in to comment.