From 845ddab4ed93eac0bef774f9fdc1aa84470b721e Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 3 Apr 2020 12:26:35 +1000 Subject: [PATCH] Omit author_email if @ not found in authors Fixes deploying to PyPI when an email address is not provided. --- src/metadata.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/metadata.rs b/src/metadata.rs index f80579701..b7a95c20d 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -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(), @@ -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]`