On Fri, Jul 6, 2012 at 11:01 AM, Éric Araujo <merwok@netwok.org> wrote:
Hopefully this will be a more useful spec.
Thanks for the proposal, but it is not really a spec. You’re suggesting name and syntax for a new field, but you don’t describe what it means and what it is used for. From what I understand, the goal is similar to build dependencies and optional dependencies in systems like Debian’s dpkg; for the build dependencies, there were multiple threads about adding Setup-Requires-Dist (like setuptools’ setup_requires) and Test-Requires-Dist (like tests_require, or whatever the spelling is—I always get it wrong :), for which we were near to agreement. See https://groups.google.com/forum/?fromgroups#!searchin/the-fellowship-of-the-... and https://groups.google.com/forum/?fromgroups#!searchin/the-fellowship-of-the-...
It is exactly the same as setuptools' "extras" feature, and I didn't quote the entire edit on-list. Also, there is a reference implementation at https://bitbucket.org/dholth/distribute/ in the DistInfoDistribution class. The 'test' and 'doc' reserved names are not an essential part of the Provides-Extra feature. Provides-Extra: is primarily for optional run-time (not build-time) dependencies.
This begs for parenthesis in environment markers, something that is easy to do by compiling markers to Python functions using the ast as `markerlib` does.
distutils2 supports Python 2.5, which has _ast but not ast IIRC. If you have other suggestions for improvements like this please open bug reports though! Feedback and patches are welcome.
markerlib is not required for Provides-Extra: It was just a convenient way to add the additional 'extra' variable name to environment markers. markerlib uses a few helpers from ast.py. Python 2.5 support would mean copying those helpers into markerlib.