New resolver: Constraints should “auto-select” extra
uranusjr opened this issue · 8 comments
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.
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! :)
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! ^>^