-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Sub-dependencies are not upgraded with the only-if-needed strategy #5274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It's intentional.
That's exactly what it is. There's a lot of discussion for this, ending in #3871. Feel free to close this issue or ask more questions here. :) |
In light of #3871 (comment), it sounds like I'm in this camp:
I'm happy to close this as intended behavior; however, I would argue against removing the eager strategy until #988 is resolved. Thanks for your response! |
The default behavior of `pip install -U` has changed as of version 10. The default only-if-needed strategy only upgrades direct dependencies of the packages being installed. This is likely to break automated upgrades such as ansible and CI deployments that use a previously generated virtual environment. Both upgrade strategies can lead to invalid virtual environment states. One could argue that the new behavior is superior because it makes minimal changes to the environment; however, my guess is that the eager strategy will cause less confusion and is identical to what pip had done prior to version 10. See also: pypa/pip#5274
The default behavior of `pip install -U` has changed as of version 10. The default only-if-needed strategy only upgrades direct dependencies of the packages being installed. This is likely to break automated upgrades such as ansible and CI deployments that use a previously generated virtual environment. Both upgrade strategies can lead to invalid virtual environment states because resolving version conflicts is not something pip claims to solve. One could argue that the new behavior is superior because it makes minimal changes to the environment; however, my guess is that the eager strategy will cause less confusion and is identical to what pip had done prior to version 10. See also: pypa/pip#5274
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description:
pip install -U
with the defaultonly-if-needed
upgrade strategy does not upgrade sub-dependencies required by the installed package.What I've run:
In a new virtualenv, I install an older version of
boto3
and then try to installmoto
. After this completes, the direct dependency (boto3
) is updated, but the sub-dependencybotocore
(a direct dependency ofboto3
) is not.This is a contrived example, but it came up when installing our package into a cached virtual environment inside our CI testing.
Behavioral question
I understand the new default
only-if-needed
upgrade strategy is causing the issue. (Running with theeager
strategy updatesbotocore
as expected.) Is it the intention that the new default behavior of pip does not upgrade sub-dependencies even when required by something being installed?I will note this is similar to #5137 except that here I am using the
-U
flag. In light of #988, I can understand why pip tries to make minimal changes without the upgrade flag. However, the new default behavior if this is not a bug seems non-intuitive. I'm having a hard time understanding a situation where the eager strategy wouldn't be the most appropriate default.The text was updated successfully, but these errors were encountered: