[Distutils] distlib and wheel metadata

Vinay Sajip vinay_sajip at yahoo.co.uk
Wed Feb 15 10:31:04 EST 2017


> the full METADATA format is documented in the pre-JSON revision of PEP 426.

Can you confirm which exact revision in the PEPs repo you mean? I could guess at 
0451397. That version does not refer to a field "Requires" (rather, the more recent 
"Requires-Dist"). Your conversion function reads the existing PKG-INFO, updates the 
Metadata-Version, and adds "Provides-Dist" and "Requires-Dist". It does not check 
whether the result conforms to that version of the PEP. For example, in the presence 
of "Requires" in PKG-INFO, you add "Requires-Dist", possibly leading to an ambiguity, 
because they sort of mean the same thing but could contain conflicting information 
(for example, different version constraints). The python-dateutils wheel which Jim 
referred to contained both "Requires" and "Requires-Dist" fields in its METADATA 
file, and, faced with a metadata set with both fields, the old packaging code used 
by distlib to handle the different metadata versions raised a "Unknown metadata set" 
error. In the face of ambiguity, it's refusing the temptation to guess :-) 

If the conversion function adds "Requires-Dist" but doesn't remove "Requires", I'm not 
sure it conforms to that version of the PEP.

Regards, 

Vinay Sajip


More information about the Distutils-SIG mailing list