{"action":"created","issue":{"url":"https://api.github.com/repos/pypa/pip/issues/3926","repository_url":"https://api.github.com/repos/pypa/pip","labels_url":"https://api.github.com/repos/pypa/pip/issues/3926/labels{/name}","comments_url":"https://api.github.com/repos/pypa/pip/issues/3926/comments","events_url":"https://api.github.com/repos/pypa/pip/issues/3926/events","html_url":"https://github.com/pypa/pip/issues/3926","id":172681690,"number":3926,"title":"Using --upgrade when requirements up to date increases runtime of pip install by 40%","user":{"login":"edmorley","id":501702,"avatar_url":"https://avatars.githubusercontent.com/u/501702?v=3","gravatar_id":"","url":"https://api.github.com/users/edmorley","html_url":"https://github.com/edmorley","followers_url":"https://api.github.com/users/edmorley/followers","following_url":"https://api.github.com/users/edmorley/following{/other_user}","gists_url":"https://api.github.com/users/edmorley/gists{/gist_id}","starred_url":"https://api.github.com/users/edmorley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edmorley/subscriptions","organizations_url":"https://api.github.com/users/edmorley/orgs","repos_url":"https://api.github.com/users/edmorley/repos","events_url":"https://api.github.com/users/edmorley/events{/privacy}","received_events_url":"https://api.github.com/users/edmorley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-23T12:04:20Z","updated_at":"2016-08-23T13:22:16Z","closed_at":null,"body":"* Pip version: 8.1.2\r\n* Python version: 2.7.11\r\n* Operating System: Tried on several (Ubuntu 14.04 with self-compiled Python, Windows 10 with MSYS2)\r\n\r\n### Description:\r\n\r\nRunning pip install with the `--upgrade` flag when the requirements are already up to date, makes the command take 40% longer than when not using `--upgrade`, due to pip re-downloading metadata from PyPI.\r\n\r\n### What I've run:\r\n\r\n1. `pip install -U setuptools==26.0.0`\r\n2. (run several times) `time pip install --disable-pip-version-check setuptools==26.0.0`\r\n3. (run several times) `time pip install --disable-pip-version-check --upgrade setuptools==26.0.0`\r\n\r\n### Expected:\r\n\r\nThe average runtime of (2) vs (3) should be the same, since the requirement is up to date (and has no sub-dependencies).\r\n\r\n### Actual:\r\n\r\nWhen not using `--upgrade` (step 2) the average time was ~0.7s, compared to ~1.0s when using `--upgrade` (step 3).\r\n\r\nAdding `--verbose` to both shows that when using `--upgrade` pip connects to PyPI to download the package version lists/metadata, which shouldn't be necessary since a local version comparison is enough to see that the package is up to date (and it doesn't have any sub-dependencies)."},"comment":{"url":"https://api.github.com/repos/pypa/pip/issues/comments/241728053","html_url":"https://github.com/pypa/pip/issues/3926#issuecomment-241728053","issue_url":"https://api.github.com/repos/pypa/pip/issues/3926","id":241728053,"user":{"login":"jamadden","id":1256082,"avatar_url":"https://avatars.githubusercontent.com/u/1256082?v=3","gravatar_id":"","url":"https://api.github.com/users/jamadden","html_url":"https://github.com/jamadden","followers_url":"https://api.github.com/users/jamadden/followers","following_url":"https://api.github.com/users/jamadden/following{/other_user}","gists_url":"https://api.github.com/users/jamadden/gists{/gist_id}","starred_url":"https://api.github.com/users/jamadden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamadden/subscriptions","organizations_url":"https://api.github.com/users/jamadden/orgs","repos_url":"https://api.github.com/users/jamadden/repos","events_url":"https://api.github.com/users/jamadden/events{/privacy}","received_events_url":"https://api.github.com/users/jamadden/received_events","type":"User","site_admin":false},"created_at":"2016-08-23T13:22:16Z","updated_at":"2016-08-23T13:22:16Z","body":"> when using --upgrade pip connects to PyPI to download the package version lists/metadata, which shouldn't be necessary since a local version comparison is enough to see that the package is up to date\r\n\r\nUnless pip *asks* what the current version of setuptools on PyPi is, how is it supposed to know that setuptools is up to date? The local version comparison is *not* sufficient. If PyPI has setuptools 56.0.0 and you have setuptools 1.0, `pip install --upgrade setuptools` *has* to check PyPi to know that it should download setuptools 56.0.0. Otherwise \"--upgrade\" is meaningless."}}
{"actor":{"display_login":"jamadden"}}