Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix maturin sdist --manifest-path for workspace project #843

Merged
merged 1 commit into from
Mar 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Package license files in `.dist-info/license_files` following PEP 639 in [#837](https://github.com/PyO3/maturin/pull/837)
* Stop testing Python 3.6 on CI since it's already EOL in [#840](https://github.com/PyO3/maturin/pull/840)
* Fix `maturin sdist --manifest-path <PATH>` for workspace project in [#843](https://github.com/PyO3/maturin/pull/843)

## [0.12.10] - 2022-03-09

Expand Down
10 changes: 8 additions & 2 deletions src/source_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,15 @@ fn add_crate_to_source_distribution(
known_path_deps: &HashMap<String, PathDependency>,
root_crate: bool,
) -> Result<()> {
let crate_dir = manifest_path.as_ref().parent().with_context(|| {
format!(
"Can't get parent directory of {}",
manifest_path.as_ref().display()
)
})?;
let output = Command::new("cargo")
.args(&["package", "--list", "--allow-dirty", "--manifest-path"])
.arg(manifest_path.as_ref())
.args(&["package", "--list", "--allow-dirty"])
.current_dir(crate_dir)
.output()
.context("Failed to run cargo")?;
if !output.status.success() {
Expand Down