[Distutils] Static metadata using setup.cfg

Tarek Ziadé ziade.tarek at gmail.com
Mon Aug 17 15:52:59 CEST 2009


2009/8/17 P.J. Eby <pje at telecommunity.com>:
> At 09:34 AM 8/17/2009 +0200, Tarek Ziadé wrote:
>>
>> Right now the behavior of the code is:
>>
>> Distutils will take the setup.cfg options and apply them to the
>> Distribution class,
>> overriding any argument passed to setup(), then they will be in turn
>> overriden by
>> the command line options if any.
>>
>> This behavior seems fine.
>>
>> Now there's a very small change to make in distutils to make this work,
>> wich consists of applying these values to the DistutilsMetadata
>> object (the metadata attribute in the dist instance)
>>
>> I've changed this in my working trunk to give a try, and it works fine.
>
> Are you doing this in setup(), Distribution.__init__,
> Distribution.parse_config_files(), Distribution.finalize_options(), or
> somewhere else?  I'm a bit concerned about backward compatibility, and
> integrating e.g. setup_requires.

I was thinking about doing it in parse_config_files(), after the files
are parsed
in the part where the "global" section is applied in the distribution object,
I've attached a diff of the dist.py if you want to take a look (that's
not the final
version but you get the idea)

>
> One of the consequences of this approach would be that if setuptools tried
> to support setup_requires this way, it could end up running recursively by
> endlessly re-parsing the same configuration file, and then creating a new
> distribution to do the installation, which in turn would parse the config
> file and see a setup_requires, and so on.

I am not sure to follow this case, would that be through fetch_build_egg ?

Tarek
-- 
Tarek Ziadé | http://ziade.org


More information about the Distutils-SIG mailing list