Skip to content

Commit 10705a7

Browse files
committed
Support core metadata versions 2.3 and 2.4
1 parent 7409f0a commit 10705a7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

internal/distributions/distribution.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,22 @@ var HeaderAttrs2_1 = append(HeaderAttrs1_2, []HeaderAttr{ // PEP 566
117117

118118
var HeaderAttrs2_2 = append(HeaderAttrs2_1, HeaderAttr{"Dynamic", "dynamic", true}) // PEP 643
119119

120+
var HeaderAttrs2_3 = HeaderAttrs2_2 // PEP 685
121+
122+
var HeaderAttrs2_4 = append(HeaderAttrs2_3, []HeaderAttr{ // PEP 639
123+
{"License-Expression", "license_expression", false},
124+
{"License-File", "license_file", false},
125+
}...)
126+
120127
var HeaderAttrs = map[string][]HeaderAttr{
121128
"1.0": HeaderAttrs1_0,
122129
"1.1": HeaderAttrs1_1,
123130
"1.2": HeaderAttrs1_2,
124131
"2.0": HeaderAttrs2_0,
125132
"2.1": HeaderAttrs2_1,
126133
"2.2": HeaderAttrs2_2,
134+
"2.3": HeaderAttrs2_3,
135+
"2.4": HeaderAttrs2_4,
127136
}
128137

129138
type Distribution interface {
@@ -175,6 +184,9 @@ type BaseDistribution struct {
175184
DescriptionContentType string `json:"description_content_type"`
176185
// version 2.2
177186
Dynamic []string `json:"dynamic"`
187+
// version 2.4
188+
LicenseExpression string `json:"license_expression"`
189+
LicenseFile string `json:"license_file"`
178190
}
179191

180192
func (bd *BaseDistribution) GetHeaderAttrs() []HeaderAttr {

0 commit comments

Comments
 (0)