Skip to content
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
11 changes: 7 additions & 4 deletions crates/uv-workspace/src/dependency_groups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::BTreeMap;
use std::str::FromStr;

use thiserror::Error;
use tracing::warn;
use tracing::error;

use uv_normalize::{GroupName, DEV_DEPENDENCIES};
use uv_pep508::Pep508Error;
Expand Down Expand Up @@ -74,9 +74,10 @@ impl FlatDependencyGroups {
.extend(resolved.get(include_group).into_iter().flatten().cloned());
}
DependencyGroupSpecifier::Object(map) => {
warn!(
"Ignoring Dependency Object Specifier referenced by `{name}`: {map:?}"
);
return Err(DependencyGroupError::DependencyObjectSpecifierNotSupported(
name.clone(),
map.clone(),
));
}
}
}
Expand Down Expand Up @@ -154,6 +155,8 @@ pub enum DependencyGroupError {
DevGroupInclude(GroupName),
#[error("Detected a cycle in `dependency-groups`: {0}")]
DependencyGroupCycle(Cycle),
#[error("Group `{0}` contains an unknown dependency object specifier: {1:?}")]
DependencyObjectSpecifierNotSupported(GroupName, BTreeMap<String, String>),
}

impl DependencyGroupError {
Expand Down
11 changes: 6 additions & 5 deletions crates/uv/tests/it/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20832,14 +20832,15 @@ fn lock_group_invalid_entry_table() -> Result<()> {
"#,
)?;

uv_snapshot!(context.filters(), context.lock(), @r###"
success: true
exit_code: 0
uv_snapshot!(context.filters(), context.lock(), @r#"
success: false
exit_code: 1
----- stdout -----

----- stderr -----
Resolved 2 packages in [TIME]
"###);
× Failed to build `project @ file://[TEMP_DIR]/`
╰─▶ Group `foo` contains an unknown dependency object specifier: {"bar": "unknown"}
"#);

Ok(())
}
Expand Down
Loading