Skip to content

Commit

Permalink
Remvove empty sources table in later PR
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 committed Oct 19, 2024
1 parent 09dd443 commit 001fde3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
14 changes: 0 additions & 14 deletions crates/uv-workspace/src/pyproject_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,20 +539,6 @@ impl PyProjectTomlMut {
{
if let Some(key) = find_source(name, sources) {
sources.remove(&key);

// Remove the `tool.uv.sources` table if it is empty.
if sources.is_empty() {
self.doc
.entry("tool")
.or_insert(implicit())
.as_table_mut()
.ok_or(Error::MalformedSources)?
.entry("uv")
.or_insert(implicit())
.as_table_mut()
.ok_or(Error::MalformedSources)?
.remove("sources");
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions crates/uv/tests/it/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,8 @@ fn add_remove_workspace() -> Result<()> {
[build-system]
requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta"
[tool.uv.sources]
"###
);
});
Expand Down

0 comments on commit 001fde3

Please sign in to comment.