Open leorochael opened 6 days ago
-1 on implementing this for the leagcy resolver. We should not be making any changes to that code - it's destined for removal.
Apart from that comment, I've not looked at this PR yet so I won't say anything more right now.
@pfmoore, I only implemented it on the legacy resolver because it was a one-liner (other than formatting).
It took a lot longer for me to add tests to the legacy resolver to check those changes than the change itself.
Adding a check on the legacy resolver to fail to work with the new option (as has been done to other changes) would have taken the same complexity.
But I'll gladly remove the change to the legacy resolver if that is the consensus. I'll await further comments on this PR before doing that.
I've fixed the remaining CI errors.
I'd appreciate a review and indication of next steps.
Some general comments, intended as a review but they seem to fit better here than in the review screen.
pip install --no-deps-for=A A B
do? Should it install C (respecting the dependencies of B) or not (respecting --no-deps-for
but breaking B)?pip install --no-deps-for=A A B
do? Install C 2.0 (respecting B's dependencies but breaking A) or not (sort of respecting --no-deps-for
, but not really because A has no dependency on C 2.0)?pip install --no-deps-for=A A B
do? Install A 1.0, B and C 2.0 (a perfectly safe resolve regardless of --no-deps-for
)? Install A 2.0, B and C 2.0 (respects --no-deps-for
but breaks A)?To be honest, I think this PR might be premature, as the behaviour isn't fully defined yet. I'd be very uncomfortable if we simply said that the answers to the above questions was "whatever this PR does, or whatever is simplest to add to this PR".
Implement
--no-deps-for=pkg
to allow ignoring sub-dependencies of specific packages, as opposed to the global--no-deps
flag.The flag is accepted on the command line and in requirements files.
Implemented in both the new and the legacy resolvers.
Also, implemented acceptance of the global
--no-deps
on the requirements file.Fixes: #9948