Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

mbox
Copy link

@mbox mbox commented Jan 18, 2013

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.

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.
@mbox
Copy link
Author

mbox commented Jan 18, 2013

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.

@pnasrat
Copy link
Contributor

pnasrat commented Jan 18, 2013

See tests/test_upgrade.py you should be able to do an assert on the result of the second run that no files are created.

@qwcode
Copy link
Contributor

qwcode commented Jan 18, 2013

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 find_requirements. If I have some time this weekend, I could flesh that out some more if needed.

@msabramo
Copy link
Contributor

msabramo commented Mar 6, 2015

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.

$ pip install --no-cache-dir -U wheel==0.24.0
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(8, 'nodename nor servname provided, or not known'))': /simple/wheel/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(8, 'nodename nor servname provided, or not known'))': /simple/wheel/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(8, 'nodename nor servname provided, or not known'))': /simple/wheel/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(8, 'nodename nor servname provided, or not known'))': /simple/wheel/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(8, 'nodename nor servname provided, or not known'))': /simple/wheel/
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(8, 'nodename nor servname provided, or not known'))': /simple/wheel/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(8, 'nodename nor servname provided, or not known'))': /simple/wheel/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(8, 'nodename nor servname provided, or not known'))': /simple/wheel/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(8, 'nodename nor servname provided, or not known'))': /simple/wheel/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(8, 'nodename nor servname provided, or not known'))': /simple/wheel/
Could not find any downloads that satisfy the requirement wheel==0.24.0 in /Users/marca/python/virtualenvs/pip/lib/python2.7/site-packages
Collecting wheel==0.24.0
  No distributions at all found for wheel==0.24.0 in /Users/marca/python/virtualenvs/pip/lib/python2.7/site-packages

Elapsed time for the above was 15 seconds.

@msabramo
Copy link
Contributor

msabramo commented Mar 6, 2015

I would recommend close this and looking at #2493, which merges cleanly.

@dstufft dstufft closed this Mar 6, 2015
msabramo added a commit to msabramo/pip that referenced this pull request Mar 17, 2015
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.
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants