[Distutils] setup.cfg new format proposal

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Wed Sep 16 02:42:24 CEST 2009

On 12:09 am, ssteinerx at gmail.com wrote:
>On Sep 15, 2009, at 7:52 PM, David Lyon wrote:
>>And imo the discussion has gone way off track..
>>The use case isn't abstract. All this discussion is about trying
>>to rewrite two lines of code.
>>-- setup.py --
>>    if sys.platform == 'win32':
>>        setup.dependencies.add('win32com','162')
>>    setup()
>>That would be the simplest way to do it in code.
>>It appears as if "if sys.platform == 'win32':"
>>is an evil line of code - that certain people
>>want to go to great lengths to stomp out.
>>It's one line of code for crying out loud...
>>We don't need a mini-language just because we
>>don't like writing it the shortest way...
>>talk about platform bias gone utterly crazy...
>Assuming that it really is that simple...
>+1 on everything above.
>A 1 line change is much better than a 30 message debate, BNF diagram, 
>and DSL for a simple case.  If it doesn't work out for some reason, 
>some _real_ reason, debate it then in context, if it ever comes up 

I don't think it's really this simple.  The point is to have static 
definition of the package information.  Having a Python program define 
this information at runtime does not satisfy this requirement.  You can 
say that the simple sys.platform test is not evil, but how does that 
lead to a solution allowing PyPI to tell users what the dependencies for 
a package are on their platform?

Still, it may be that if the only use case here is conditionally 
declaring a dependency if the install target is Windows, a simpler 
solution might suffice.  I won't try to describe such a solution. 
Instead, I'll ask if that premise seems valid.

What use cases do we have?  There's the one described above, which lots 
of people have been talking about.  I think there's another one related 
to target Python version - eg, on Python 2.3, depend on simplejson, but 
on Python 2.6, don't.  What else?


More information about the Distutils-SIG mailing list