Skip to content

Commit ee2551d

Browse files
authored
Merge pull request #10 from matt-phylum/license-expression
add license-expression and license-file support
2 parents 53abb81 + 221644a commit ee2551d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/metadata.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,15 @@ pub struct Metadata {
4646
/// 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.
4747
#[cfg_attr(feature = "serde", serde(default))]
4848
pub author_email: Option<String>,
49-
/// Text indicating the license covering the distribution where the license is not a selection from the `License` Trove classifiers.
49+
/// Text indicating the license covering the distribution where the license is not a selection from the `License` Trove classifiers or an SPDX license expression.
5050
#[cfg_attr(feature = "serde", serde(default))]
5151
pub license: Option<String>,
52+
/// An SPDX expression indicating the license covering the distribution.
53+
#[cfg_attr(feature = "serde", serde(default))]
54+
pub license_expression: Option<String>,
55+
/// Paths to files containing the text of the licenses covering the distribution.
56+
#[cfg_attr(feature = "serde", serde(default))]
57+
pub license_files: Vec<String>,
5258
/// Each entry is a string giving a single classification value for the distribution.
5359
#[cfg_attr(feature = "serde", serde(default))]
5460
pub classifiers: Vec<String>,
@@ -152,6 +158,8 @@ impl Metadata {
152158
let author = get_first_value("Author");
153159
let author_email = get_first_value("Author-email");
154160
let license = get_first_value("License");
161+
let license_expression = get_first_value("License-Expression");
162+
let license_files = get_all_values("License-File");
155163
let classifiers = get_all_values("Classifier");
156164
let requires_dist = get_all_values("Requires-Dist");
157165
let provides_dist = get_all_values("Provides-Dist");
@@ -178,6 +186,8 @@ impl Metadata {
178186
author,
179187
author_email,
180188
license,
189+
license_expression,
190+
license_files,
181191
classifiers,
182192
requires_dist,
183193
provides_dist,

0 commit comments

Comments
 (0)