-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix for #770: pip install -U shouldn't look at pypi if not needed #771
Conversation
If an exact version is specified for install, and that version is already installed, then there is no point going to pypi as no install is needed.
I haven't worked out how to write a testcase for this yet - any pointers welcome. If I figure it out I'll add one. |
See |
The test isn't whether or not the upgrade writes new files (currently, it's not, so that's not changing), the test would be confirming the package finder is not exercised (after this change). a unit test would be best here that mocks PackageFinder and asserts no calls are made on |
So this seems to still be an issue, though you have to turn off pip's caching or clear the cache to see it; otherwise the cache will prevent it from hitting the Internet.
Elapsed time for the above was 15 seconds. |
I would recommend close this and looking at #2493, which merges cleanly. |
If an exact version is specified for install, and that version is already installed, then there is no point going to pypi as no install is needed. Adds a test called `test_upgrade_no_look_at_pypi_if_exact_version_installed`. This is a rework of PR pypa#771, because that PR is old and has merge conflicts that were easier to fix by applying the changes manually.
Fix for issue #770: If an exact version is specified for install, and that version is
already installed, then there is no point going to pypi as no install
is needed.