From test_install_with_extras_from_constraints
. Say package foo
has extra [extra]
that pulls in bar
(no default dependencies). A constraint like this:
# constraints.txt
foo[extra]
should let the following command
pip install -c constraints.txt foo
install both foo
and bar
. We are not doing this right now.
Clarifying based on a comment made by @dstufft here. This seems incorrect - constraints should not cause anything to be installed.
We should look at the test to understand better what it's trying to achieve, and consider that the test may actually be wrong.
I would be surprised by the behavior described here.
I agree -- I think we should not do this. I can see why the current resolver is doing this (it's got logic to "promote" constraints to requirements, and I'm pretty sure that person wasn't thinking of extras when they wrote that) and... I view this as a bug and not a feature. :)
No idea why we're testing this, and digging through the blame for the test commit to see if there's any original discussion here might be useful. I'm not gonna do that, since I have a lot on my plate already -- and there's too many plates too! :)
A quick blame brought me to #3189.
Closing as a "won't do".
If we don't want to do that, a warning stating that:
the extra
extra
from linefoo[extra]
fromconstraints.txt
is ignored
would be nice.
I believe the current implementation is to hard error with “InstallationError: constraint can’t have extras” or something similar.
I believe the current implementation is to hard error with “InstallationError: constraint can’t have extras” or something similar.
We have this now; that's why I closed this. Sorry for the lack of clarity! ^>^
Most helpful comment
Clarifying based on a comment made by @dstufft here. This seems incorrect - constraints should not cause anything to be installed.
We should look at the test to understand better what it's trying to achieve, and consider that the test may actually be wrong.