Skip to content

Commit 67ea397

Browse files
committed
add license-expression support
1 parent bf1d4e8 commit 67ea397

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/metadata.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ 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>,
5255
/// Each entry is a string giving a single classification value for the distribution.
5356
#[cfg_attr(feature = "serde", serde(default))]
5457
pub classifiers: Vec<String>,
@@ -152,6 +155,7 @@ impl Metadata {
152155
let author = get_first_value("Author");
153156
let author_email = get_first_value("Author-email");
154157
let license = get_first_value("License");
158+
let license_expression = get_first_value("License-Expression");
155159
let classifiers = get_all_values("Classifier");
156160
let requires_dist = get_all_values("Requires-Dist");
157161
let provides_dist = get_all_values("Provides-Dist");
@@ -178,6 +182,7 @@ impl Metadata {
178182
author,
179183
author_email,
180184
license,
185+
license_expression,
181186
classifiers,
182187
requires_dist,
183188
provides_dist,

0 commit comments

Comments
 (0)