-
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
pip install -U shouldn't go to pypi if the requirement is already installed #770
Comments
I'm assuming your requirements in pip-reqs.txt have specific versions? |
Yes, that's correct - all the packages in the pip-reqs.txt have versions, which are already installed. So you're right - the bug is that it shouldn't go off to pypi unless the requirement is not already satisfied. I've changed the title to reflect that. |
Am I right in thinking the bug is here https://github.com/pypa/pip/blob/develop/pip/req.py#L1072 where if self.upgrade is set, the satisfied_by flag is reset - which presumably causes the update to pull from pypi? |
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.
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 #770: pip install -U shouldn't look at pypi if not needed
I'm going to close this, we've decided that we're not going to do this. With the new PEP 440 rules the |
Setup a virtualenv with all requirements in pip-reqs.txt installed (requirements that all have a specific version specified)
Running pip install -U and pip install should both be No-ops as nothing needs to be installed.
However the -U version runs about 1000x slower than the straight install:
Both runs end up not installing anything - although the -U version does hit two git repos (but it's every single check that's slower, so time isn't accounted for by these pulls)
Environment:
pip 1.2.1 running on Linux
The text was updated successfully, but these errors were encountered: