Skip to content

Commit

Permalink
Only remove [tool.uv.sources] if it is no long being referenced
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 committed Oct 19, 2024
1 parent 0ceaeeb commit 2b7528b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/uv-workspace/src/pyproject_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,11 @@ impl PyProjectTomlMut {

/// Remove a matching source from `tool.uv.sources`, if it exists.
fn remove_source(&mut self, name: &PackageName) -> Result<(), Error> {
// If the dependency is still in use, don't remove the source.
if !self.find_dependency(name, None).is_empty() {
return Ok(());
}

if let Some(sources) = self
.doc
.get_mut("tool")
Expand Down

0 comments on commit 2b7528b

Please sign in to comment.