Skip to content

Commit

Permalink
Add Python metadata support for license-file field of Cargo.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Oct 13, 2022
1 parent 33338f5 commit 982b772
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Usage is by setting `--target wasm32-wasi`.
* Add support for python first [`src` project layout](https://py-pkgs.org/04-package-structure.html#the-source-layout) in [#1185](https://github.com/PyO3/maturin/pull/1185)
* Add `--src` option to generate src layout for mixed Python/Rust projects in [#1189](https://github.com/PyO3/maturin/pull/1189)
* Add Python metadata support for `license-file` field of `Cargo.toml` in [#1195](https://github.com/PyO3/maturin/pull/1195)

## [0.13.6] - 2022-10-08

Expand Down
7 changes: 6 additions & 1 deletion src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ impl Metadata21 {
if let Some(repository) = package.repository.as_ref() {
project_url.insert("Source Code".to_string(), repository.clone());
}
let license_files = if let Some(license_file) = package.license_file.as_ref() {
vec![manifest_path.as_ref().join(license_file)]
} else {
Vec::new()
};

let metadata = Metadata21 {
metadata_version: "2.1".to_owned(),
Expand All @@ -373,7 +378,7 @@ impl Metadata21 {
},
author_email,
license: package.license.clone(),
license_files: Vec::new(),
license_files,

// Values provided through `[project.metadata.maturin]`
classifiers,
Expand Down

0 comments on commit 982b772

Please sign in to comment.