From 630c4c79ca983f20d2f7ed4314ea6f3505e516fb Mon Sep 17 00:00:00 2001 From: messense Date: Wed, 7 Dec 2022 23:06:22 +0800 Subject: [PATCH] Fix sdist when all Cargo workspace members are excluded --- Changelog.md | 1 + src/source_distribution.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index c5554fb1d..52a12f141 100644 --- a/Changelog.md +++ b/Changelog.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * **Breaking Change**: Remove deprecated `python-source` option in `Cargo.toml` in [#1335](https://github.com/PyO3/maturin/pull/1335) * **Breaking Change**: Turn `patchelf` version warning into a hard error in [#1335](https://github.com/PyO3/maturin/pull/1335) * Support `SOURCE_DATE_EPOCH` when building wheels in [#1334](https://github.com/PyO3/maturin/pull/1334) +* Fix sdist when all Cargo workspace members are excluded in [#1343](https://github.com/PyO3/maturin/pull/1343) ## [0.14.4] - 2022-12-05 diff --git a/src/source_distribution.rs b/src/source_distribution.rs index e285cf66f..b1df251c4 100644 --- a/src/source_distribution.rs +++ b/src/source_distribution.rs @@ -213,8 +213,10 @@ fn rewrite_cargo_toml( } if !new_members.is_empty() { workspace["members"] = toml_edit::value(new_members); - rewritten = true; + } else { + workspace.remove("members"); } + rewritten = true; } } }