[Distutils] Alternate static metadata PEP submission...

David Cournapeau david at ar.media.kyoto-u.ac.jp
Thu Oct 15 06:39:32 CEST 2009


David Lyon wrote:
> [dependencies]
> packages = pyopengl
>
> [dependencies python<=2.4]
> packages = lxml >= 2.5
>
> [dependencies mac python<=2.4]
> packages = shinyxml
>
> Translates roughly into the following python code:
>
>     dependencies = ["pyopengl"]
>     if sys.version <= '2.4':
>         dependencies.append('lxml')
>         if sys.platform == 'darwin':
>             dependencies.append('shinyxml')
>
> So to me, configparser does provide a way to achieve a
> sort of nested capability.
>   

I understand this, but when you a lot of conditioning, "flattening" the
conditions is not really readable. If you have say 10 variables instead
of 2 to condition on, the sections would be several lines.

More significantly though, how can you define new conditions variables
with .ini files ? Would you have a special section for this ?

David


More information about the Distutils-SIG mailing list