Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update dependencies, set release to 0.14.0 #719

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
503 changes: 281 additions & 222 deletions Cargo.lock

Large diffs are not rendered by default.

66 changes: 33 additions & 33 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["rust-tests"]

[package]
name = "rattler-build"
version = "0.13.0"
version = "0.14.0"
authors = ["Wolf Vollprecht <[email protected]>"]
homepage = "https://github.com/prefix-dev/rattler-build"
edition = "2021"
Expand All @@ -20,39 +20,39 @@ tui = ['ratatui', 'crossterm', 'ansi-to-tui', 'throbber-widgets-tui', 'tui-input

[dependencies]
serde = { version = "1.0.197", features = ["derive"] }
serde_yaml = "0.9.32"
rattler = { version = "0.19.0", default-features = false, features = ["cli-tools"] }
rattler_conda_types = { version = "0.19.0", default-features = false }
rattler_digest = { version = "0.19.0", default-features = false }
rattler_index = { version = "0.19.0", default-features = false }
rattler_networking = { version = "0.19.0", default-features = false }
rattler_repodata_gateway = { version = "0.19.0", default-features = false, features = [
serde_yaml = "0.9.33"
rattler = { version = "0.19.4", default-features = false, features = ["cli-tools"] }
rattler_conda_types = { version = "0.20.2", default-features = false }
rattler_digest = { version = "0.19.2", default-features = false }
rattler_index = { version = "0.19.3", default-features = false }
rattler_networking = { version = "0.19.2", default-features = false }
rattler_repodata_gateway = { version = "0.19.3", default-features = false, features = [
"sparse",
] }
rattler_shell = { version = "0.19.0", default-features = false, features = [
rattler_shell = { version = "0.19.3", default-features = false, features = [
"sysinfo",
] }
rattler_solve = { version = "0.19.0", default-features = false, features = [
rattler_solve = { version = "0.20.2", default-features = false, features = [
"resolvo",
] }
rattler_virtual_packages = { version = "0.19.0", default-features = false }
rattler_package_streaming = { version = "0.19.0", default-features = false }
anyhow = "1.0.80"
rattler_virtual_packages = { version = "0.19.3", default-features = false }
rattler_package_streaming = { version = "0.20.0", default-features = false }
anyhow = "1.0.81"
walkdir = "2.5.0"
sha2 = "0.10.8"
hex = "0.4.3"
serde_json = "1.0.114"
reqwest = { version = "0.11.24", default-features = false, features = [
reqwest = { version = "0.11.27", default-features = false, features = [
"multipart",
] }
tokio = { version = "1.36.0", features = ["rt", "macros", "rt-multi-thread"] }
itertools = "0.12.1"
content_inspector = "0.2.4"
serde_with = "3.6.1"
serde_with = "3.7.0"
url = "2.5.0"
tracing = "0.1.40"
clap = { version = "4.5.1", features = ["derive", "env", "cargo"] }
minijinja = { version = "1.0.12", features = [
clap = { version = "4.5.3", features = ["derive", "env", "cargo"] }
minijinja = { version = "1.0.14", features = [
"unstable_machinery",
"custom_syntax",
] }
Expand All @@ -63,7 +63,7 @@ tracing-subscriber = { version = "0.3.18", features = [
"json"
] }
marked-yaml = { version = "0.3.0" }
miette = { version = "7.1.0", features = ["fancy"] }
miette = { version = "7.2.0", features = ["fancy"] }
num_cpus = "1.16.0"
goblin = "0.8.0"
scroll = "0.12.0"
Expand All @@ -73,9 +73,9 @@ futures = "0.3.30"
indicatif = "0.17.8"
console = { version = "0.15.8", features = ["windows-console-colors"] }
once_cell = "1.19.0"
thiserror = "1.0.57"
thiserror = "1.0.58"
tempfile = "3.10.1"
chrono = "0.4.34"
chrono = "0.4.35"
sha1 = "0.10.6"
spdx = "0.10.4"
fs_extra = "1.3.0"
Expand All @@ -102,10 +102,10 @@ base64 = "0.22.0"
flate2 = "1.0.28"
xz2 = "0.1.7"
zstd = "0.13.0"
toml = "0.8.10"
toml = "0.8.12"
memmap2 = "0.9.4"
os_pipe = "1.1.5"
reqwest-middleware = "0.2.4"
reqwest-middleware = "0.2.5"
rattler_installs_packages = { version = "0.8.1", default-features = false }
async-once-cell = "0.5.3"
terminal_size = "0.3.0"
Expand All @@ -130,17 +130,17 @@ pre-build = [
"apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH",
]

[patch.crates-io]
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_index = { 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_package_streaming = { git = "https://github.com/mamba-org/rattler", branch = "main" }
# [patch.crates-io]
# 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_index = { 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_package_streaming = { git = "https://github.com/mamba-org/rattler", branch = "main" }

# rattler = { path = "../rattler/crates/rattler" }
# rattler_conda_types = { path = "../rattler/crates/rattler_conda_types" }
Expand Down
2 changes: 1 addition & 1 deletion rust-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
[dependencies]
glob = "0.3.1"
itertools = "0.12.1"
rattler_package_streaming = { version = "0.19.0", default-features = false }
rattler_package_streaming = { version = "0.20.0", default-features = false }
serde_json = "1.0.114"
sha1 = "0.10.6"
duct = "0.13.7"
5 changes: 3 additions & 2 deletions src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ mod test {
use chrono::TimeZone;
use insta::assert_yaml_snapshot;
use rattler_conda_types::{
MatchSpec, NoArchType, PackageName, PackageRecord, RepoDataRecord, VersionWithSource,
MatchSpec, NoArchType, PackageName, PackageRecord, ParseStrictness, RepoDataRecord,
VersionWithSource,
};
use rattler_digest::{parse_digest_from_hex, Md5, Sha256};
use url::Url;
Expand Down Expand Up @@ -658,7 +659,7 @@ mod test {
fn test_resolved_dependencies_rendering() {
let resolved_dependencies = resolved_dependencies::ResolvedDependencies {
specs: vec![DependencyInfo::Raw {
spec: MatchSpec::from_str("python 3.12.* h12332").unwrap(),
spec: MatchSpec::from_str("python 3.12.* h12332", ParseStrictness::Strict).unwrap(),
}],
resolved: vec![RepoDataRecord {
package_record: PackageRecord {
Expand Down
18 changes: 11 additions & 7 deletions src/package_test/run_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use fs_err as fs;
use rattler_conda_types::package::IndexJson;
use rattler_conda_types::ParseStrictness;
use std::fmt::Write as fmt_write;
use std::{
path::{Path, PathBuf},
Expand Down Expand Up @@ -288,12 +289,13 @@ pub async fn run_test(package_file: &Path, config: &TestConfiguration) -> Result

let mut dependencies: Vec<MatchSpec> = test_dependencies
.iter()
.map(|s| MatchSpec::from_str(s))
.map(|s| MatchSpec::from_str(s, ParseStrictness::Lenient))
.collect::<Result<Vec<_>, _>>()?;

tracing::info!("Creating test environment in {:?}", prefix);
let match_spec = MatchSpec::from_str(
format!("{}={}={}", pkg.name, pkg.version, pkg.build_string).as_str(),
ParseStrictness::Lenient,
)
.map_err(|e| TestError::MatchSpecParse(e.to_string()))?;
dependencies.push(match_spec);
Expand Down Expand Up @@ -352,12 +354,13 @@ async fn run_python_test(
let test_file = path.join("python_test.json");
let test: PythonTest = serde_json::from_reader(fs::File::open(test_file)?)?;

let match_spec =
MatchSpec::from_str(format!("{}={}={}", pkg.name, pkg.version, pkg.build_string).as_str())
.unwrap();
let match_spec = MatchSpec::from_str(
format!("{}={}={}", pkg.name, pkg.version, pkg.build_string).as_str(),
ParseStrictness::Lenient,
)?;
let mut dependencies = vec![match_spec];
if test.pip_check {
dependencies.push(MatchSpec::from_str("pip").unwrap());
dependencies.push(MatchSpec::from_str("pip", ParseStrictness::Strict).unwrap());
}

create_environment(
Expand Down Expand Up @@ -431,7 +434,7 @@ async fn run_shell_test(
let build_dependencies = deps
.build
.iter()
.map(|s| MatchSpec::from_str(s))
.map(|s| MatchSpec::from_str(s, ParseStrictness::Lenient))
.collect::<Result<Vec<_>, _>>()?;

create_environment(
Expand All @@ -451,12 +454,13 @@ async fn run_shell_test(
let mut dependencies = deps
.run
.iter()
.map(|s| MatchSpec::from_str(s))
.map(|s| MatchSpec::from_str(s, ParseStrictness::Lenient))
.collect::<Result<Vec<_>, _>>()?;

// create environment with the test dependencies
dependencies.push(MatchSpec::from_str(
format!("{}={}={}", pkg.name, pkg.version, pkg.build_string).as_str(),
ParseStrictness::Lenient,
)?);

let platform = config.target_platform.unwrap_or_else(Platform::current);
Expand Down
15 changes: 8 additions & 7 deletions src/recipe/jinja.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{collections::BTreeMap, str::FromStr};

use minijinja::value::Object;
use minijinja::{Environment, Value};
use rattler_conda_types::{PackageName, Version};
use rattler_conda_types::{PackageName, ParseStrictness, Version};

pub use crate::render::pin::{Pin, PinExpression};
pub use crate::selectors::SelectorConfig;
Expand Down Expand Up @@ -161,12 +161,13 @@ fn set_jinja(config: &SelectorConfig) -> minijinja::Environment<'static> {
format!("Failed to deserialize `version`: {}", e),
)
})?;
let version_spec = VersionSpec::from_str(spec).map_err(|e| {
minijinja::Error::new(
minijinja::ErrorKind::SyntaxError,
format!("Bad syntax for `spec`: {}", e),
)
})?;
let version_spec =
VersionSpec::from_str(spec, ParseStrictness::Strict).map_err(|e| {
minijinja::Error::new(
minijinja::ErrorKind::SyntaxError,
format!("Bad syntax for `spec`: {}", e),
)
})?;
Ok(version_spec.matches(&version))
} else {
// if a is undefined, we are currently searching for all variants and thus return true
Expand Down
5 changes: 2 additions & 3 deletions src/recipe/parser/requirements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

use crate::recipe::parser::FlattenErrors;
use indexmap::IndexSet;
use rattler_conda_types::{MatchSpec, PackageName};
use rattler_conda_types::{MatchSpec, PackageName, ParseStrictness};
use serde::de::Error;
use serde::{Deserialize, Serialize};
use std::str::FromStr;

use crate::recipe::custom_yaml::RenderedSequenceNode;
use crate::{
Expand Down Expand Up @@ -352,7 +351,7 @@ impl TryConvertNode<MatchSpec> for RenderedNode {

impl TryConvertNode<MatchSpec> for RenderedScalarNode {
fn try_convert(&self, name: &str) -> Result<MatchSpec, Vec<PartialParsingError>> {
MatchSpec::from_str(self.as_str()).map_err(|err| {
MatchSpec::from_str(self.as_str(), ParseStrictness::Strict).map_err(|err| {
vec![_partialerror!(
*self.span(),
ErrorKind::from(err),
Expand Down
14 changes: 6 additions & 8 deletions src/render/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
str::FromStr,
};

use rattler_conda_types::{MatchSpec, PackageName, Version};
use rattler_conda_types::{MatchSpec, PackageName, ParseStrictness, Version};
use serde::{de, Deserialize, Deserializer, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down Expand Up @@ -74,12 +74,10 @@ impl Pin {
/// are given, the pin is applied to the version accordingly.
pub fn apply(&self, version: &Version, hash: &str) -> Result<MatchSpec, PinError> {
if self.exact {
return Ok(MatchSpec::from_str(&format!(
"{} {} {}",
self.name.as_normalized(),
version,
hash
))
return Ok(MatchSpec::from_str(
&format!("{} {} {}", self.name.as_normalized(), version, hash),
ParseStrictness::Strict,
)
// TODO use MatchSpecError when it becomes accessible
.map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidInput, e))?);
}
Expand Down Expand Up @@ -140,7 +138,7 @@ impl Pin {
spec.push(',');
spec.push_str(&format!("<{}", pin));

Ok(MatchSpec::from_str(spec.as_str())
Ok(MatchSpec::from_str(spec.as_str(), ParseStrictness::Strict)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidInput, e))?)
}

Expand Down
19 changes: 10 additions & 9 deletions src/render/resolved_dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ use indicatif::HumanBytes;
use rattler::package_cache::CacheKey;
use rattler_conda_types::{
package::{PackageFile, RunExportsJson},
MatchSpec, PackageName, Platform, RepoDataRecord, StringMatcher, Version, VersionSpec,
MatchSpec, PackageName, ParseStrictness, Platform, RepoDataRecord, StringMatcher, Version,
VersionSpec,
};
use rattler_conda_types::{version_spec::ParseVersionSpecError, PackageRecord};
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -329,7 +330,7 @@ pub fn apply_variant(

// we split at whitespace to separate into version and build
let mut splitter = spec.split_whitespace();
let version_spec = splitter.next().map(VersionSpec::from_str).transpose()?;
let version_spec = splitter.next().map(|v| VersionSpec::from_str(v, ParseStrictness::Strict)).transpose()?;
let build_spec = splitter.next().map(StringMatcher::from_str).transpose()?;
let final_spec = MatchSpec {
version: version_spec,
Expand Down Expand Up @@ -431,7 +432,7 @@ pub fn apply_variant(
};

Ok(DependencyInfo::Compiler {
spec: MatchSpec::from_str(&final_compiler)?,
spec: MatchSpec::from_str(&final_compiler, ParseStrictness::Strict)?,
})
}
}
Expand Down Expand Up @@ -580,7 +581,7 @@ async fn resolve_dependencies(
-> Result<Vec<DependencyInfo>, ResolveError> {
let mut cloned = Vec::new();
for spec in specs {
let spec = MatchSpec::from_str(spec)?;
let spec = MatchSpec::from_str(spec, ParseStrictness::Strict)?;
let in_ignore_run_exports = |pkg| {
output
.recipe
Expand Down Expand Up @@ -811,20 +812,20 @@ mod tests {
fn test_dependency_info_render() {
let dep_info = vec![
DependencyInfo::Raw {
spec: MatchSpec::from_str("xyz").unwrap(),
spec: MatchSpec::from_str("xyz", ParseStrictness::Strict).unwrap(),
},
DependencyInfo::Variant {
spec: MatchSpec::from_str("foo").unwrap(),
spec: MatchSpec::from_str("foo", ParseStrictness::Strict).unwrap(),
variant: "bar".to_string(),
},
DependencyInfo::Compiler {
spec: MatchSpec::from_str("foo").unwrap(),
spec: MatchSpec::from_str("foo", ParseStrictness::Strict).unwrap(),
},
DependencyInfo::PinSubpackage {
spec: MatchSpec::from_str("baz").unwrap(),
spec: MatchSpec::from_str("baz", ParseStrictness::Strict).unwrap(),
},
DependencyInfo::PinCompatible {
spec: MatchSpec::from_str("bat").unwrap(),
spec: MatchSpec::from_str("bat", ParseStrictness::Strict).unwrap(),
},
];
let yaml_str = serde_yaml::to_string(&dep_info).unwrap();
Expand Down
Loading