[Distutils] How to specific metadata version in setup.py?

Sridhar Ratnakumar sridharr at activestate.com
Sat Mar 20 08:33:24 CET 2010


On 2010-03-19, at 2:51 PM, Tarek Ziadé wrote:

> On Fri, Mar 19, 2010 at 5:35 PM, Sridhar Ratnakumar
> <sridharr at activestate.com> wrote:
>> [..]
> If Tres is reading this, I had to do the following hack as
>> a workaroud:
>>     from pkginfo import Distribution
>> 
>>     class PkgInfoFile(Distribution):
>>         # Not all packages' PKG-INFO define the proper metadata
>>         # For eg., modern-package-template uses the Classifiers field and
>> yet
>>         # uses 1.0 as the metadata version (Classifiers is only defined in
>> 1.1)
>>         metadata_version = '1.2' # not all PKG-INFO file have proper
>> metadata version
> 
> Why do you force 1.2 here ?

From http://pypi.python.org/pypi/pkginfo

"Added support for the different metadata versions specified in PEPs 241,  314,  and 345. Distributions now parse and expose only the attributes corresponding to their metadata version,  which defaults to the version parsed from the PKG-INFO file. The programmer can override that version when creating the distribution object."

I could as well use 1.1.

> There's no tool out there that understand
> PEP 345 / 1.2 yet.

Apparently pkginfo supports PEP 345 (see above).

> At this time, I'd encourage you to put 1.1 here unless you use PEP 345 fields.

Ok.

-srid


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20100320/d3152ed5/attachment.html>


More information about the Distutils-SIG mailing list