Skip to content

Commit

Permalink
Omit author_email if @ not found in authors
Browse files Browse the repository at this point in the history
Fixes deploying to PyPI when an email address is not provided.
  • Loading branch information
dae committed Apr 3, 2020
1 parent 450aa7a commit 845ddab
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ impl Metadata21 {

let extra_metadata = cargo_toml.remaining_core_metadata();

let author_email = if authors.contains('@') {
Some(authors.clone())
} else {
None
};

Ok(Metadata21 {
metadata_version: "2.1".to_owned(),

Expand All @@ -104,8 +110,8 @@ impl Metadata21 {
home_page: cargo_toml.package.homepage.clone(),
download_url: None,
// Cargo.toml has no distinction between author and author email
author: Some(authors.to_owned()),
author_email: Some(authors),
author: Some(authors),
author_email,
license: cargo_toml.package.license.clone(),

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

0 comments on commit 845ddab

Please sign in to comment.