diff --git a/crates/uv-workspace/src/workspace.rs b/crates/uv-workspace/src/workspace.rs index edeb36a4e490..829f5d09e070 100644 --- a/crates/uv-workspace/src/workspace.rs +++ b/crates/uv-workspace/src/workspace.rs @@ -195,7 +195,17 @@ impl Workspace { .as_ref() .map(|optional_dependencies| { // It's a `BTreeMap` so the keys are sorted. - optional_dependencies.keys().cloned().collect::>() + optional_dependencies + .iter() + .filter_map(|(name, dependencies)| { + if dependencies.is_empty() { + None + } else { + Some(name) + } + }) + .cloned() + .collect::>() }) .unwrap_or_default();