[Distutils] setup.cfg new format proposal

Tarek Ziadé ziade.tarek at gmail.com
Tue Sep 15 13:38:22 CEST 2009


On Tue, Sep 15, 2009 at 1:34 PM, Jeff Rush <jeff at taupro.com> wrote:
> Tarek Ziadé wrote:
>>
>> Imagine a command with the name "foo", that has an option called "condition".
>>
>> The setup.cfg file might look like this:
>>
>> """
>> [global]
>> verbose: 1
>>
>> [setup]
>> name: MyDistribution
>> version: 1.0
>>
>> [only_windows]
>> condition: sys_platform == 'win32'
>> requires: pywin32
>>
>> [foo]
>> verbose: 1
>> condition: badababdalolo
>> """"
>>
>> Here, the foo section is not supposed to be used by the setup section,
>> it's just a section for the command value, which is allowed (see
>> http://docs.python.org/distutils/configfile.html)
>
> Ooh, nasty.  I would -want- this case to error out because it could
> introduce a hard to find problem.  Perhaps that condition: is intended
> for use by [setup] but a tired person forgot to list it in [setup].  He
> keeps looking at his setup.cfg and cannot see why it doesn't use his
> condition.  I'd rather a big error popped up than a silent ambiguity.

Another options is to prefix those sections that are to be used with [setup]:

"""
[global]
verbose: 1

[setup]
name: MyDistribution
version: 1.0

[setup:only_windows]
condition: sys_platform == 'win32'
requires: pywin32

[setup:only_mac]
condition: sys_platform == 'darwin'
requires: pywin32

[foo]
verbose: 1
condition: badababdalolo
""""


>
> -Jeff
>



-- 
Tarek Ziadé | http://ziade.org | オープンソースはすごい!


More information about the Distutils-SIG mailing list