@@ -132,6 +132,9 @@ class RawMetadata(TypedDict, total=False):
132132 license_expression : str
133133 license_files : list [str ]
134134
135+ # Metadata 2.5 - PEP 771
136+ default_extra : list [str ]
137+
135138
136139_STRING_FIELDS = {
137140 "author" ,
@@ -253,6 +256,7 @@ def _get_payload(msg: email.message.Message, source: bytes | str) -> str:
253256 "author-email" : "author_email" ,
254257 "classifier" : "classifiers" ,
255258 "description" : "description" ,
259+ "default-extra" : "default_extra" ,
256260 "description-content-type" : "description_content_type" ,
257261 "download-url" : "download_url" ,
258262 "dynamic" : "dynamic" ,
@@ -463,8 +467,8 @@ def parse_email(data: bytes | str) -> tuple[RawMetadata, dict[str, list[str]]]:
463467
464468
465469# 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" ]
468472
469473_REQUIRED_ATTRS = frozenset (["metadata_version" , "name" , "version" ])
470474
@@ -861,3 +865,9 @@ def from_email(cls, data: bytes | str, *, validate: bool = True) -> Metadata:
861865 """``Provides`` (deprecated)"""
862866 obsoletes : _Validator [list [str ] | None ] = _Validator (added = "1.1" )
863867 """``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