[Distutils] Should pip support extras? Was: [venv] question about future pip capabilities

Jorge Vargas jorge.vargas at gmail.com
Tue Dec 15 00:26:02 CET 2009


On Thu, Dec 10, 2009 at 3:58 PM, Darren Dale <dsdale24 at gmail.com> wrote:
> On Thu, Dec 10, 2009 at 2:30 PM, Ian Bicking <ianb at colorstudy.com> wrote:
>> On Thu, Dec 10, 2009 at 11:18 AM, Darren Dale <dsdale24 at gmail.com> wrote:

>> There isn't really; extras would be nice, but there hasn't been much
>> demand for them.  pip requirement files serve a similar purpose though
>> in a somewhat different way.
>
> I brought this up on the virtualenv mailing list once before.
> Requirements files serve a very different use-case. If I want to
> define a project extra like foo[traits_qt4] that depends on a project
> with an extra like traits[qt4] > 3.2.0, I can't just list traits[qt4]
>> 3.2.0 in my requirements file, because pip is not designed to
> recursively check the (arbitrarily-named) requirements files of the
> dependencies I declare in my own requirements file. I have to keep
> track of not only my projects dependencies, but my dependencies
> dependencies, and on and on.
>
I think the problem with extras is that the concept itself is flawed.
python lacks this optional dependecies paradigm and we end up with a
bunch of hacks to get the optional dependencies to work. And in the
end you get to maintain code that checks at runtime which "option" to
choose making the extras stuff redundant at best. I can't really think
of a case where
pip install lib backend1
pip install lib backend2

can't replace

pip install lib[backend1]
pip install lib[backend2]

as for requirements being a replacement what's wrong with having
several files? sure it's a little duplication (and it may get
exponential if you depend on a package that depends on other optional
dependencies) but seriously which % of package suffer from that?

IMO extras was a misfeature that should be slowly deprecated.

> Regards,
> Darren
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig
>


More information about the Distutils-SIG mailing list