Skip to content

Commit

Permalink
Keep dev-dependencies in sdist when there are no path dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Jan 31, 2023
1 parent 396d777 commit 843bf17
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/source_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ fn rewrite_cargo_toml(
// ^^^^^^^^^^^^^ dep_name
for dep_category in ["dependencies", "dev-dependencies", "build-dependencies"] {
if let Some(table) = data.get_mut(dep_category).and_then(|x| x.as_table_mut()) {
if dep_category == "dev-dependencies" {
// Remove dev-dependencies since building from sdist doesn't need them
if dep_category == "dev-dependencies" && !known_path_deps.is_empty() {
// Remove dev-dependencies since building from sdist doesn't need them,
// Keep it when there are no path dependencies to support building from
// sdist with `--locked`/`--frozen`.
data.remove(dep_category);
rewritten = true;
continue;
Expand Down

0 comments on commit 843bf17

Please sign in to comment.