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

Tarek Ziadé ziade.tarek at gmail.com
Fri Mar 19 22:22:03 CET 2010

On Fri, Mar 19, 2010 at 5:10 PM, Sridhar Ratnakumar
<sridharr at activestate.com> wrote:
> My package's PKG-INFO defaults to 1.0 metadata version. I tried
> searching http://docs.python.org/distutils/ to know how to specify 1.2 as
> the metadata version (so I can include Classifiers[1], maintainer* fields in
> it), but couldn't find any. Does anyone know? Shouldn't this be documented
> in http://docs.python.org/distutils/setupscript.html which talks about these
> additional fields in section 2.8?
> -srid
> [1] Evidently, some packages in PyPI do not have 'Classifiers' in their
> metadata (PKG-INFO) despite specifying it in the setup.py.

You can't do it, distutils will automatically set 1.0 or 1.1 depending
on the options you have used. (and not 1.2)
IOW, if you use a PEP 314 field, the DistributionMetadata object
should switch to 1.1.

ALthough, my advice would be to use the new DistributionMetadata class
I have created in distutils2. It's a standalone, PEP 345-compatible
class you can use in your own project. It has a micro-interpreter for
the environment markers described in PEP 345, and also knows how to
read or write 1.1, 1.0 PKG-INFO files.


Feedback and contributions are welcome


> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig

Tarek Ziadé | http://ziade.org

More information about the Distutils-SIG mailing list