Skip to content
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 @@ -3,6 +3,7 @@
## Unreleased

* Fix adding `project.license-files` to source distributions.
* Fix relative Readme rewrite of the root crate in source distributions.

## [1.9.2]

Expand Down
25 changes: 14 additions & 11 deletions src/source_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,17 +502,8 @@ fn add_cargo_package_files_to_sdist(
.unwrap()
.strip_prefix(&sdist_root)
.unwrap();
add_crate_to_source_distribution(
writer,
manifest_path,
root_dir.join(relative_main_crate_manifest_dir),
None,
&known_path_deps,
true,
false,
)?;
// Handle possible relative readme field in Cargo.toml
if let Some(readme) = main_crate.readme.as_ref() {
let readme_path = if let Some(readme) = main_crate.readme.as_ref() {
let readme = abs_manifest_dir.join(readme);
let abs_readme = readme
.normalize()
Expand All @@ -531,7 +522,19 @@ fn add_cargo_package_files_to_sdist(
.join(readme.file_name().unwrap()),
&abs_readme,
)?;
}
Some(abs_readme)
} else {
None
};
add_crate_to_source_distribution(
writer,
manifest_path,
root_dir.join(relative_main_crate_manifest_dir),
readme_path.as_deref(),
&known_path_deps,
true,
false,
)?;

// Add Cargo.lock file and workspace Cargo.toml
let manifest_cargo_lock_path = abs_manifest_dir.join("Cargo.lock");
Expand Down
1 change: 1 addition & 0 deletions tests/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ fn workspace_members_non_local_dep_sdist() {
edition = "2021"
description = "Implements a dummy function (get_fortytwo.DummyClass.get_42()) in rust"
license = "MIT"
readme = "README.md"

[dependencies]
pyo3 = { version = "0.25.0", features = [
Expand Down
Loading