diff --git a/crates/uv-workspace/src/dependency_groups.rs b/crates/uv-workspace/src/dependency_groups.rs index edb4ef88e..ad3e9b4b2 100644 --- a/crates/uv-workspace/src/dependency_groups.rs +++ b/crates/uv-workspace/src/dependency_groups.rs @@ -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; @@ -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(), + )); } } } @@ -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), } impl DependencyGroupError { diff --git a/crates/uv/tests/it/lock.rs b/crates/uv/tests/it/lock.rs index 2eb497294..5c7a1202b 100644 --- a/crates/uv/tests/it/lock.rs +++ b/crates/uv/tests/it/lock.rs @@ -20833,14 +20833,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(()) }