[Python-Dev] Distutils ML wrap-up: setup.cfg new format

David Lyon david.lyon at preisshare.net
Thu Sep 24 01:59:29 CEST 2009


On Wed, 23 Sep 2009 09:49:16 +0200, "M.-A. Lemburg" <mal at egenix.com> wrote:

> While it's a good idea to put up some form of meta-data
> into an index, I wonder why you are using setup.cfg
> for this.
> 
> setup.cfg has traditionally been used to configure distutils,
> not to define meta-data. As such you wouldn't want to
> put such a configuration file up on PyPI.
> 
> Wouldn't it be better use a new file for this (with the
> same syntax), e.g. metadata.cfg ?! This would then just
> contain the meta data that needs to be published.

Forgive me if I answer this from being on the distutils-ml
but it is easy to answer and might save somebody else time.

Currently, the metadata is stored within setup.py and the
biggest issue with that is maintaining the version number.
For instance, getting the same version number to go into the
documentation files, etc. So consensus was that keeping that 
information in setup.py is somewhat cumbersome and putting
it somewhere else would be better. Tarek suggested setup.cfg
and it seems to make the most sense.

By moving the metadata values into a configParser format file, 
it would mean that external scripts could more easily 
access/update the version number as required.

Of course, setup.cfg wouldn't get uploaded. Nobody would
want to do that.

But distutils would create the .PKG_INFO file and metadata
from configuration, and not from hardcoded string values
within setup.py as it does now.

David







More information about the Python-Dev mailing list