@@ -132,6 +132,9 @@ class RawMetadata(TypedDict, total=False):
132
132
license_expression : str
133
133
license_files : list [str ]
134
134
135
+ # Metadata 2.5 - PEP 771
136
+ default_extra : list [str ]
137
+
135
138
136
139
_STRING_FIELDS = {
137
140
"author" ,
@@ -253,6 +256,7 @@ def _get_payload(msg: email.message.Message, source: bytes | str) -> str:
253
256
"author-email" : "author_email" ,
254
257
"classifier" : "classifiers" ,
255
258
"description" : "description" ,
259
+ "default-extra" : "default_extra" ,
256
260
"description-content-type" : "description_content_type" ,
257
261
"download-url" : "download_url" ,
258
262
"dynamic" : "dynamic" ,
@@ -463,8 +467,8 @@ def parse_email(data: bytes | str) -> tuple[RawMetadata, dict[str, list[str]]]:
463
467
464
468
465
469
# Keep the two values in sync.
466
- _VALID_METADATA_VERSIONS = ["1.0" , "1.1" , "1.2" , "2.1" , "2.2" , "2.3" , "2.4" ]
467
- _MetadataVersion = Literal ["1.0" , "1.1" , "1.2" , "2.1" , "2.2" , "2.3" , "2.4" ]
470
+ _VALID_METADATA_VERSIONS = ["1.0" , "1.1" , "1.2" , "2.1" , "2.2" , "2.3" , "2.4" , "2.5" ]
471
+ _MetadataVersion = Literal ["1.0" , "1.1" , "1.2" , "2.1" , "2.2" , "2.3" , "2.4" , "2.5" ]
468
472
469
473
_REQUIRED_ATTRS = frozenset (["metadata_version" , "name" , "version" ])
470
474
@@ -861,3 +865,9 @@ def from_email(cls, data: bytes | str, *, validate: bool = True) -> Metadata:
861
865
"""``Provides`` (deprecated)"""
862
866
obsoletes : _Validator [list [str ] | None ] = _Validator (added = "1.1" )
863
867
"""``Obsoletes`` (deprecated)"""
868
+ # PEP 771 lets us define a default `extras_require` if none is passed by the
869
+ # user.
870
+ default_extra : _Validator [list [utils .NormalizedName ] | None ] = _Validator (
871
+ added = "2.5" ,
872
+ )
873
+ """:external:ref:`core-metadata-default-extra`"""
0 commit comments