Skip to content

Commit 6c9f03d

Browse files
wolfvbaszalmstra
andauthored
feat: parse matchspec conditions and translate to resolvo (#1545)
Co-authored-by: Bas Zalmstra <[email protected]>
1 parent 8e2abc5 commit 6c9f03d

17 files changed

+906
-99
lines changed

.github/workflows/rust-compile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
RUST_BACKTRACE: 1
2323
RUSTFLAGS: "-D warnings"
2424
CARGO_TERM_COLOR: always
25-
DEFAULT_FEATURES: indicatif,tokio,serde,reqwest,sparse,gateway,resolvo,libsolv_c,s3,experimental_extras,edit,rattler_config
25+
DEFAULT_FEATURES: indicatif,tokio,serde,reqwest,sparse,gateway,resolvo,libsolv_c,s3,experimental_extras,experimental_conditionals,edit,rattler_config
2626

2727
jobs:
2828
check-rustdoc-links:

Cargo.lock

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

crates/rattler_conda_types/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ readme.workspace = true
1212

1313
[features]
1414
default = ["rayon"]
15-
experimental_extras = []
15+
experimental_extras = ["experimental_conditionals"]
16+
experimental_conditionals = []
1617

1718
[dependencies]
1819
ahash = { workspace = true }

crates/rattler_conda_types/src/channel/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl serde::Serialize for NamedChannelOrUrl {
187187
}
188188

189189
/// `Channel`s are the primary source of package information.
190-
#[derive(Debug, Clone, Serialize, Eq, PartialEq, Hash)]
190+
#[derive(Debug, Clone, Serialize, Eq, PartialEq, Hash, Deserialize)]
191191
pub struct Channel {
192192
/// The platforms supported by this channel, or None if no explicit
193193
/// platforms have been specified.
@@ -198,6 +198,7 @@ pub struct Channel {
198198
pub base_url: ChannelUrl,
199199

200200
/// The name of the channel
201+
#[serde(skip_serializing_if = "Option::is_none")]
201202
pub name: Option<String>,
202203
}
203204

crates/rattler_conda_types/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ pub use explicit_environment_spec::{
4141
ParseExplicitEnvironmentSpecError, ParsePackageArchiveHashError,
4242
};
4343
pub use generic_virtual_package::GenericVirtualPackage;
44+
#[cfg(feature = "experimental_conditionals")]
45+
pub use match_spec::condition::MatchSpecCondition;
4446
pub use match_spec::{
4547
matcher::{StringMatcher, StringMatcherParseError},
4648
parse::ParseMatchSpecError,

0 commit comments

Comments
 (0)