{"action":"created","issue":{"url":"https://api.github.com/repos/nvie/pip-tools/issues/281","labels_url":"https://api.github.com/repos/nvie/pip-tools/issues/281/labels{/name}","comments_url":"https://api.github.com/repos/nvie/pip-tools/issues/281/comments","events_url":"https://api.github.com/repos/nvie/pip-tools/issues/281/events","html_url":"https://github.com/nvie/pip-tools/pull/281","id":124112633,"number":281,"title":"Feature - \"no upgrade\" flag for only upgrading as necessary","user":{"login":"ejames","id":163937,"avatar_url":"https://avatars.githubusercontent.com/u/163937?v=3","gravatar_id":"","url":"https://api.github.com/users/ejames","html_url":"https://github.com/ejames","followers_url":"https://api.github.com/users/ejames/followers","following_url":"https://api.github.com/users/ejames/following{/other_user}","gists_url":"https://api.github.com/users/ejames/gists{/gist_id}","starred_url":"https://api.github.com/users/ejames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejames/subscriptions","organizations_url":"https://api.github.com/users/ejames/orgs","repos_url":"https://api.github.com/users/ejames/repos","events_url":"https://api.github.com/users/ejames/events{/privacy}","received_events_url":"https://api.github.com/users/ejames/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-28T19:37:48Z","updated_at":"2016-01-14T08:33:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nvie/pip-tools/pulls/281","html_url":"https://github.com/nvie/pip-tools/pull/281","diff_url":"https://github.com/nvie/pip-tools/pull/281.diff","patch_url":"https://github.com/nvie/pip-tools/pull/281.patch"},"body":"Resolve issue #166 by adding a \"--no-upgrade\" flag to pip-compile.\r\n\r\nIf there's already an existing file that would be overwritten by running pip-compile, read in that file, and remember the existing pinned requirement.  Whenever looking for the best match for a package, take the existing pinned requirement if it satisfies the constraints we're applying.\r\n\r\nA test is added for the resolver.  The new dependency `frobnicator==1.0.0` is output by the resolver, and the preexisting `widgetizer==1.0.0` pin is changed to `widgetizer==2.0.0` because `frobnicator` requires an upgraded version of `widgetizer`, but the preexisting `flux-capacitor` pin is not moved even though a later version of `flux-capacitor` is available in the fixture."},"comment":{"url":"https://api.github.com/repos/nvie/pip-tools/issues/comments/171571596","html_url":"https://github.com/nvie/pip-tools/pull/281#issuecomment-171571596","issue_url":"https://api.github.com/repos/nvie/pip-tools/issues/281","id":171571596,"user":{"login":"nvie","id":83844,"avatar_url":"https://avatars.githubusercontent.com/u/83844?v=3","gravatar_id":"","url":"https://api.github.com/users/nvie","html_url":"https://github.com/nvie","followers_url":"https://api.github.com/users/nvie/followers","following_url":"https://api.github.com/users/nvie/following{/other_user}","gists_url":"https://api.github.com/users/nvie/gists{/gist_id}","starred_url":"https://api.github.com/users/nvie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvie/subscriptions","organizations_url":"https://api.github.com/users/nvie/orgs","repos_url":"https://api.github.com/users/nvie/repos","events_url":"https://api.github.com/users/nvie/events{/privacy}","received_events_url":"https://api.github.com/users/nvie/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T08:33:16Z","updated_at":"2016-01-14T08:33:16Z","body":"Perhaps a clearer example / test case.\r\n\r\nSuppose you are already using jinja2 and werkzeug, but not Flask yet.\r\n\r\n    $ cat requirements.in\r\n    jinja2\r\n    werkzeug\r\n\r\nAnd suppose your werkzeug is on a (very) old version, but you use a recent (but not _most_ recent Jinja2 version):\r\n\r\n    $ cat requirements.txt\r\n    #\r\n    # This file is autogenerated by pip-compile\r\n    # Make changes in foo.in, then run this to update:\r\n    #\r\n    #    pip-compile foo.in\r\n    #\r\n    jinja2==2.7.3          # NOTE: reasonably recent, 2.8 is newer\r\n    markupsafe==0.23       # via jinja2\r\n    werkzeug==0.6          # NOTE: pretty old version of werkzeug\r\n\r\nNext, you decide to also use Flask for your project. So you add \"flask\" to the *.in file, and then run `pip-compile --no-upgrade`. Since the latest version of Flask requires `werkzeug>=0.7` (we don't have it, but it still fits our specs) and `jinja2>=2.4` (we already satisfy that). So what _should_ happen is:\r\n\r\n    $ cat requirements.txt\r\n    #\r\n    # This file is autogenerated by pip-compile\r\n    # Make changes in foo.in, then run this to update:\r\n    #\r\n    #    pip-compile foo.in\r\n    #\r\n    flask==0.10.1\r\n    jinja2==2.7.3          # UNTOUCHED\r\n    markupsafe==0.23       # UNTOUCHED\r\n    werkzeug==0.11.3          # bumped to latest version matching our specs\r\n    ...\r\n\r\nThe point being that werkzeug should still be updated, even though we specified `--no-upgrade`. But Jinja2 isn't. If we had `werkzeug<0.10` in our original *.in file, this upgrade should fail since it could not satisfy the new requirement with the existing requirements. Simply ignoring werkzeug in this process because it's already in our output file misses these cases."}}