Error when tool.uv.sources contains duplicate package names (#7383)

## Summary

Closes https://github.com/astral-sh/uv/issues/7229.
This commit is contained in:
Charlie Marsh 2024-09-13 23:37:23 -04:00 committed by GitHub
parent 211fa91c2a
commit 083ec2f1bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 154 additions and 13 deletions

View file

@ -14,7 +14,7 @@ use uv_fs::{Simplified, CWD};
use uv_normalize::{GroupName, PackageName, DEV_DEPENDENCIES};
use uv_warnings::{warn_user, warn_user_once};
use crate::pyproject::{Project, PyProjectToml, Source, ToolUvWorkspace};
use crate::pyproject::{Project, PyProjectToml, Source, ToolUvSources, ToolUvWorkspace};
#[derive(thiserror::Error, Debug)]
pub enum WorkspaceError {
@ -234,6 +234,7 @@ impl Workspace {
.clone()
.and_then(|tool| tool.uv)
.and_then(|uv| uv.sources)
.map(ToolUvSources::into_inner)
.unwrap_or_default();
// Set the `pyproject.toml` for the member.
@ -741,6 +742,7 @@ impl Workspace {
.clone()
.and_then(|tool| tool.uv)
.and_then(|uv| uv.sources)
.map(ToolUvSources::into_inner)
.unwrap_or_default();
Ok(Workspace {