[Distutils] [Python-Dev] distlib updated with resources API

David Cournapeau cournape at gmail.com
Mon Oct 1 16:29:29 CEST 2012


On Mon, Oct 1, 2012 at 3:15 PM, Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
> David Cournapeau <cournape <at> gmail.com> writes:
>
>> Note that in Cabal at least, those conditionals work not just for
>> requirements, but for pretty much any section that is not metadata (so
>> in the python world, you could condition on the package you want to
>> install, etc...).
>
> Right, but the concept of environment markers is simple enough that we should
> be able to extend to other areas. Requirements are just the most obvious
> application.

I think we just need to see how it looks like in real cases to get a
good idea about tradeoffs syntax-wise.

>
>> That's great. May I ask you to put this code somewhere ? This would
>> allow me to try using this inside bento. It would allow using whatever
>> format you are ending up with directly with existing projects (bento
>> is is already used by some complex packages such as numpy or scipy).
>> It would be a good way to ensure the format provides enough semantics.
>
> Which code do you mean? Although I have written some code to produce metadata in
> YAML format, I have not yet got anything that consumes it to a reasonable point
> (apart from sdist generation, which should not be environment-specific).

The code that produces yaml files. The point is precisely that it
would be easy for me to consume this and produce the internal package
representation in bento, which would then allow to configure, build
and install packages using the bento format.

> I will publish what I have as soon as it has reached a reasonable state of
> usefulness. Precisely because it isn't declarative, existing environment-specific
> code in setup.py files in PyPI archives is not easy to convert to environment
> markers automatically :-(

I am curious: do you attempt to parse the setup.py to get those
environment markers ? I personally gave up on this and just run the
setup.py to get whatever values are available in that precise
environment. Given that versions are not normalized, I am afraid
trying to do better is bound to fail, but maybe I am not smart enough
to do it :)

David


More information about the Distutils-SIG mailing list