Skip to content

Commit

Permalink
fix: empty cbc (#1351)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv authored Jan 18, 2025
1 parent 858541c commit f35a22e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 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.35.4"
version = "0.35.5"
authors = ["rattler-build contributors <[email protected]>"]
repository = "https://github.com/prefix-dev/rattler-build"
edition = "2021"
Expand Down
4 changes: 2 additions & 2 deletions py-rattler-build/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion py-rattler-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "py-rattler-build"
version = "0.35.4"
version = "0.35.5"
edition = "2021"
license = "BSD-3-Clause"
publish = false
Expand Down
15 changes: 14 additions & 1 deletion src/conda_build_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,22 @@ pub fn load_conda_build_config(
)
})?;

if value.is_null() {
return Ok(VariantConfig::default());
}

// filter all empty maps
let value = value
.as_mapping()
.unwrap()
.ok_or_else(|| {
VariantConfigError::IOError(
path.to_path_buf(),
std::io::Error::new(
std::io::ErrorKind::InvalidData,
"Expected `conda_build_config.yaml` to be a mapping",
),
)
})?
.clone()
.into_iter()
.filter(|(_, v)| !v.is_null())
Expand Down Expand Up @@ -181,6 +193,7 @@ mod tests {

#[rstest]
#[case("conda_build_config/test_1.yaml", None)]
#[case("conda_build_config/all_filtered.yaml", None)]
#[case("conda_build_config/conda_forge_subset.yaml", Some(false))]
#[case("conda_build_config/conda_forge_subset.yaml", Some(true))]
#[case("conda_build_config/conda_forge_subset.yaml", None)]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: src/conda_build_config.rs
expression: config
---
pin_run_as_build: ~
zip_keys: ~
2 changes: 2 additions & 0 deletions test-data/conda_build_config/all_filtered.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
c_stdlib_version: # [false]
- 10.15 # [false]

0 comments on commit f35a22e

Please sign in to comment.