11use std:: str:: FromStr ;
22
3- use crate :: Error ;
43use mailparse:: MailHeaderMap ;
54#[ cfg( feature = "serde" ) ]
65use serde:: { Deserialize , Serialize } ;
76
7+ use crate :: Error ;
8+
89/// Python package metadata
910#[ cfg_attr( feature = "serde" , derive( Deserialize , Serialize ) ) ]
1011#[ derive( Debug , Clone , Default , PartialEq ) ]
@@ -17,9 +18,11 @@ pub struct Metadata {
1718 pub version : String ,
1819 /// A Platform specification describing an operating system supported by the distribution
1920 /// which is not listed in the “Operating System” Trove classifiers.
21+ #[ cfg_attr( feature = "serde" , serde( rename = "platform" ) ) ]
2022 pub platforms : Vec < String > ,
2123 /// Binary distributions containing a PKG-INFO file will use the Supported-Platform field
2224 /// in their metadata to specify the OS and CPU for which the binary distribution was compiled.
25+ #[ cfg_attr( feature = "serde" , serde( skip_serializing) ) ]
2326 pub supported_platforms : Vec < String > ,
2427 /// A one-line summary of what the distribution does.
2528 pub summary : Option < String > ,
@@ -66,11 +69,13 @@ pub struct Metadata {
6669 pub project_urls : Vec < String > ,
6770 /// A string containing the name of an optional feature. Must be a valid Python identifier.
6871 /// May be used to make a dependency conditional on whether the optional feature has been requested.
72+ #[ cfg_attr( feature = "serde" , serde( skip_serializing) ) ]
6973 pub provides_extras : Vec < String > ,
7074 /// A string stating the markup syntax (if any) used in the distribution’s description,
7175 /// so that tools can intelligently render the description.
7276 pub description_content_type : Option < String > ,
7377 /// A string containing the name of another core metadata field.
78+ #[ cfg_attr( feature = "serde" , serde( skip_serializing) ) ]
7479 pub dynamic : Vec < String > ,
7580}
7681
0 commit comments