Skip to content

Commit

Permalink
Merge pull request #10 from matt-phylum/license-expression
Browse files Browse the repository at this point in the history
add license-expression and license-file support
  • Loading branch information
messense authored Aug 13, 2023
2 parents 53abb81 + 221644a commit ee2551d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@ pub struct Metadata {
/// A string containing the author’s e-mail address. It can contain a name and e-mail address in the legal forms for a RFC-822 `From:` header.
#[cfg_attr(feature = "serde", serde(default))]
pub author_email: Option<String>,
/// Text indicating the license covering the distribution where the license is not a selection from the `License` Trove classifiers.
/// Text indicating the license covering the distribution where the license is not a selection from the `License` Trove classifiers or an SPDX license expression.
#[cfg_attr(feature = "serde", serde(default))]
pub license: Option<String>,
/// An SPDX expression indicating the license covering the distribution.
#[cfg_attr(feature = "serde", serde(default))]
pub license_expression: Option<String>,
/// Paths to files containing the text of the licenses covering the distribution.
#[cfg_attr(feature = "serde", serde(default))]
pub license_files: Vec<String>,
/// Each entry is a string giving a single classification value for the distribution.
#[cfg_attr(feature = "serde", serde(default))]
pub classifiers: Vec<String>,
Expand Down Expand Up @@ -152,6 +158,8 @@ impl Metadata {
let author = get_first_value("Author");
let author_email = get_first_value("Author-email");
let license = get_first_value("License");
let license_expression = get_first_value("License-Expression");
let license_files = get_all_values("License-File");
let classifiers = get_all_values("Classifier");
let requires_dist = get_all_values("Requires-Dist");
let provides_dist = get_all_values("Provides-Dist");
Expand All @@ -178,6 +186,8 @@ impl Metadata {
author,
author_email,
license,
license_expression,
license_files,
classifiers,
requires_dist,
provides_dist,
Expand Down

0 comments on commit ee2551d

Please sign in to comment.