{"action":"created","comment":{"url":"https://api.github.com/repos/pypa/pip/pulls/comments/39103151","id":39103151,"diff_hunk":"@@ -0,0 +1,131 @@\n+from __future__ import absolute_import\n+\n+import logging\n+import os\n+\n+from pip.req import RequirementSet\n+from pip.basecommand import RequirementCommand\n+from pip import cmdoptions\n+from pip.utils.build import BuildDirectory\n+from pip.utils.filesystem import check_path_owner\n+\n+\n+logger = logging.getLogger(__name__)\n+\n+\n+class DownloadCommand(RequirementCommand):\n+    \"\"\"\n+    Download packages from:\n+\n+    - PyPI (and other indexes) using requirement specifiers.\n+    - VCS project urls.\n+    - Local project directories.\n+    - Local or remote source archives.\n+\n+    pip also supports downloading from \"requirements files\", which provide\n+    an easy way to specify a whole environment to be downloaded.\n+    \"\"\"\n+    name = 'download'\n+\n+    usage = \"\"\"\n+      %prog [options] <requirement specifier> [package-index-options] ...\n+      %prog [options] -r <requirements file> [package-index-options] ...\n+      %prog [options] [-e] <vcs project url> ...\n+      %prog [options] [-e] <local project path> ...\n+      %prog [options] <archive url/path> ...\"\"\"\n+\n+    summary = 'Download packages.'\n+\n+    def __init__(self, *args, **kw):\n+        super(DownloadCommand, self).__init__(*args, **kw)\n+\n+        cmd_opts = self.cmd_opts\n+\n+        cmd_opts.add_option(cmdoptions.constraints())\n+        cmd_opts.add_option(cmdoptions.editable())\n+        cmd_opts.add_option(cmdoptions.requirements())\n+        cmd_opts.add_option(cmdoptions.build_dir())\n+        cmd_opts.add_option(cmdoptions.no_deps())\n+        cmd_opts.add_option(cmdoptions.global_options())\n+        cmd_opts.add_option(cmdoptions.no_binary())\n+        cmd_opts.add_option(cmdoptions.only_binary())\n+        cmd_opts.add_option(cmdoptions.src())\n+        cmd_opts.add_option(cmdoptions.no_clean())\n+        cmd_opts.add_option(cmdoptions.pre())\n+\n+        cmd_opts.add_option(\n+            '-d', '--dest', '--destination-dir', '--destination-directory',\n+            dest='download_dir',\n+            metavar='dir',\n+            default=None,","path":"pip/commands/download.py","position":60,"original_position":60,"commit_id":"3d2f45c344da19b62655e0f3329c888b00919d43","original_commit_id":"3d2f45c344da19b62655e0f3329c888b00919d43","user":{"login":"xavfernandez","id":1089744,"avatar_url":"https://avatars.githubusercontent.com/u/1089744?v=3","gravatar_id":"","url":"https://api.github.com/users/xavfernandez","html_url":"https://github.com/xavfernandez","followers_url":"https://api.github.com/users/xavfernandez/followers","following_url":"https://api.github.com/users/xavfernandez/following{/other_user}","gists_url":"https://api.github.com/users/xavfernandez/gists{/gist_id}","starred_url":"https://api.github.com/users/xavfernandez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xavfernandez/subscriptions","organizations_url":"https://api.github.com/users/xavfernandez/orgs","repos_url":"https://api.github.com/users/xavfernandez/repos","events_url":"https://api.github.com/users/xavfernandez/events{/privacy}","received_events_url":"https://api.github.com/users/xavfernandez/received_events","type":"User","site_admin":false},"body":"I think this one should default to something like the current directory or maybe `./pip_downloads` (to mimic the way `pip wheel` works, cf https://github.com/pypa/pip/blob/develop/pip/commands/wheel.py#L18).\r\n\r\nWith the default being None, `pip download something` currently deletes everything it has downloaded.","created_at":"2015-09-09T22:07:18Z","updated_at":"2015-09-09T22:07:18Z","html_url":"https://github.com/pypa/pip/pull/3085#discussion_r39103151","pull_request_url":"https://api.github.com/repos/pypa/pip/pulls/3085","_links":{"self":{"href":"https://api.github.com/repos/pypa/pip/pulls/comments/39103151"},"html":{"href":"https://github.com/pypa/pip/pull/3085#discussion_r39103151"},"pull_request":{"href":"https://api.github.com/repos/pypa/pip/pulls/3085"}}},"pull_request":{"url":"https://api.github.com/repos/pypa/pip/pulls/3085","id":44481101,"html_url":"https://github.com/pypa/pip/pull/3085","diff_url":"https://github.com/pypa/pip/pull/3085.diff","patch_url":"https://github.com/pypa/pip/pull/3085.patch","issue_url":"https://api.github.com/repos/pypa/pip/issues/3085","number":3085,"state":"open","locked":false,"title":"Add `pip download` command and deprecate `pip install --download`.","user":{"login":"patricklaw","id":577694,"avatar_url":"https://avatars.githubusercontent.com/u/577694?v=3","gravatar_id":"","url":"https://api.github.com/users/patricklaw","html_url":"https://github.com/patricklaw","followers_url":"https://api.github.com/users/patricklaw/followers","following_url":"https://api.github.com/users/patricklaw/following{/other_user}","gists_url":"https://api.github.com/users/patricklaw/gists{/gist_id}","starred_url":"https://api.github.com/users/patricklaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patricklaw/subscriptions","organizations_url":"https://api.github.com/users/patricklaw/orgs","repos_url":"https://api.github.com/users/patricklaw/repos","events_url":"https://api.github.com/users/patricklaw/events{/privacy}","received_events_url":"https://api.github.com/users/patricklaw/received_events","type":"User","site_admin":false},"body":"This is a followup to https://github.com/pypa/pip/pull/2995","created_at":"2015-09-08T20:48:55Z","updated_at":"2015-09-09T22:07:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ed7344dad1baa4a893faa2926e79b40344bfacf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pypa/pip/pulls/3085/commits","review_comments_url":"https://api.github.com/repos/pypa/pip/pulls/3085/comments","review_comment_url":"https://api.github.com/repos/pypa/pip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pypa/pip/issues/3085/comments","statuses_url":"https://api.github.com/repos/pypa/pip/statuses/3d2f45c344da19b62655e0f3329c888b00919d43","head":{"label":"patricklaw:add-pip-download-command","ref":"add-pip-download-command","sha":"3d2f45c344da19b62655e0f3329c888b00919d43","user":{"login":"patricklaw","id":577694,"avatar_url":"https://avatars.githubusercontent.com/u/577694?v=3","gravatar_id":"","url":"https://api.github.com/users/patricklaw","html_url":"https://github.com/patricklaw","followers_url":"https://api.github.com/users/patricklaw/followers","following_url":"https://api.github.com/users/patricklaw/following{/other_user}","gists_url":"https://api.github.com/users/patricklaw/gists{/gist_id}","starred_url":"https://api.github.com/users/patricklaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patricklaw/subscriptions","organizations_url":"https://api.github.com/users/patricklaw/orgs","repos_url":"https://api.github.com/users/patricklaw/repos","events_url":"https://api.github.com/users/patricklaw/events{/privacy}","received_events_url":"https://api.github.com/users/patricklaw/received_events","type":"User","site_admin":false},"repo":{"id":29692351,"name":"pip","full_name":"patricklaw/pip","owner":{"login":"patricklaw","id":577694,"avatar_url":"https://avatars.githubusercontent.com/u/577694?v=3","gravatar_id":"","url":"https://api.github.com/users/patricklaw","html_url":"https://github.com/patricklaw","followers_url":"https://api.github.com/users/patricklaw/followers","following_url":"https://api.github.com/users/patricklaw/following{/other_user}","gists_url":"https://api.github.com/users/patricklaw/gists{/gist_id}","starred_url":"https://api.github.com/users/patricklaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patricklaw/subscriptions","organizations_url":"https://api.github.com/users/patricklaw/orgs","repos_url":"https://api.github.com/users/patricklaw/repos","events_url":"https://api.github.com/users/patricklaw/events{/privacy}","received_events_url":"https://api.github.com/users/patricklaw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/patricklaw/pip","description":"The PyPA recommended tool for installing Python packages","fork":true,"url":"https://api.github.com/repos/patricklaw/pip","forks_url":"https://api.github.com/repos/patricklaw/pip/forks","keys_url":"https://api.github.com/repos/patricklaw/pip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/patricklaw/pip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/patricklaw/pip/teams","hooks_url":"https://api.github.com/repos/patricklaw/pip/hooks","issue_events_url":"https://api.github.com/repos/patricklaw/pip/issues/events{/number}","events_url":"https://api.github.com/repos/patricklaw/pip/events","assignees_url":"https://api.github.com/repos/patricklaw/pip/assignees{/user}","branches_url":"https://api.github.com/repos/patricklaw/pip/branches{/branch}","tags_url":"https://api.github.com/repos/patricklaw/pip/tags","blobs_url":"https://api.github.com/repos/patricklaw/pip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/patricklaw/pip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/patricklaw/pip/git/refs{/sha}","trees_url":"https://api.github.com/repos/patricklaw/pip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/patricklaw/pip/statuses/{sha}","languages_url":"https://api.github.com/repos/patricklaw/pip/languages","stargazers_url":"https://api.github.com/repos/patricklaw/pip/stargazers","contributors_url":"https://api.github.com/repos/patricklaw/pip/contributors","subscribers_url":"https://api.github.com/repos/patricklaw/pip/subscribers","subscription_url":"https://api.github.com/repos/patricklaw/pip/subscription","commits_url":"https://api.github.com/repos/patricklaw/pip/commits{/sha}","git_commits_url":"https://api.github.com/repos/patricklaw/pip/git/commits{/sha}","comments_url":"https://api.github.com/repos/patricklaw/pip/comments{/number}","issue_comment_url":"https://api.github.com/repos/patricklaw/pip/issues/comments{/number}","contents_url":"https://api.github.com/repos/patricklaw/pip/contents/{+path}","compare_url":"https://api.github.com/repos/patricklaw/pip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/patricklaw/pip/merges","archive_url":"https://api.github.com/repos/patricklaw/pip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/patricklaw/pip/downloads","issues_url":"https://api.github.com/repos/patricklaw/pip/issues{/number}","pulls_url":"https://api.github.com/repos/patricklaw/pip/pulls{/number}","milestones_url":"https://api.github.com/repos/patricklaw/pip/milestones{/number}","notifications_url":"https://api.github.com/repos/patricklaw/pip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/patricklaw/pip/labels{/name}","releases_url":"https://api.github.com/repos/patricklaw/pip/releases{/id}","created_at":"2015-01-22T18:05:16Z","updated_at":"2015-01-22T18:05:18Z","pushed_at":"2015-09-09T03:13:39Z","git_url":"git://github.com/patricklaw/pip.git","ssh_url":"git@github.com:patricklaw/pip.git","clone_url":"https://github.com/patricklaw/pip.git","svn_url":"https://github.com/patricklaw/pip","homepage":"https://pip.pypa.io/","size":26663,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"pypa:develop","ref":"develop","sha":"bd863d7c6efd8cc8a0b41934766c8db561e57bc9","user":{"login":"pypa","id":647025,"avatar_url":"https://avatars.githubusercontent.com/u/647025?v=3","gravatar_id":"","url":"https://api.github.com/users/pypa","html_url":"https://github.com/pypa","followers_url":"https://api.github.com/users/pypa/followers","following_url":"https://api.github.com/users/pypa/following{/other_user}","gists_url":"https://api.github.com/users/pypa/gists{/gist_id}","starred_url":"https://api.github.com/users/pypa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypa/subscriptions","organizations_url":"https://api.github.com/users/pypa/orgs","repos_url":"https://api.github.com/users/pypa/repos","events_url":"https://api.github.com/users/pypa/events{/privacy}","received_events_url":"https://api.github.com/users/pypa/received_events","type":"Organization","site_admin":false},"repo":{"id":1446467,"name":"pip","full_name":"pypa/pip","owner":{"login":"pypa","id":647025,"avatar_url":"https://avatars.githubusercontent.com/u/647025?v=3","gravatar_id":"","url":"https://api.github.com/users/pypa","html_url":"https://github.com/pypa","followers_url":"https://api.github.com/users/pypa/followers","following_url":"https://api.github.com/users/pypa/following{/other_user}","gists_url":"https://api.github.com/users/pypa/gists{/gist_id}","starred_url":"https://api.github.com/users/pypa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypa/subscriptions","organizations_url":"https://api.github.com/users/pypa/orgs","repos_url":"https://api.github.com/users/pypa/repos","events_url":"https://api.github.com/users/pypa/events{/privacy}","received_events_url":"https://api.github.com/users/pypa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pypa/pip","description":"The PyPA recommended tool for installing Python packages","fork":false,"url":"https://api.github.com/repos/pypa/pip","forks_url":"https://api.github.com/repos/pypa/pip/forks","keys_url":"https://api.github.com/repos/pypa/pip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pypa/pip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pypa/pip/teams","hooks_url":"https://api.github.com/repos/pypa/pip/hooks","issue_events_url":"https://api.github.com/repos/pypa/pip/issues/events{/number}","events_url":"https://api.github.com/repos/pypa/pip/events","assignees_url":"https://api.github.com/repos/pypa/pip/assignees{/user}","branches_url":"https://api.github.com/repos/pypa/pip/branches{/branch}","tags_url":"https://api.github.com/repos/pypa/pip/tags","blobs_url":"https://api.github.com/repos/pypa/pip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pypa/pip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pypa/pip/git/refs{/sha}","trees_url":"https://api.github.com/repos/pypa/pip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pypa/pip/statuses/{sha}","languages_url":"https://api.github.com/repos/pypa/pip/languages","stargazers_url":"https://api.github.com/repos/pypa/pip/stargazers","contributors_url":"https://api.github.com/repos/pypa/pip/contributors","subscribers_url":"https://api.github.com/repos/pypa/pip/subscribers","subscription_url":"https://api.github.com/repos/pypa/pip/subscription","commits_url":"https://api.github.com/repos/pypa/pip/commits{/sha}","git_commits_url":"https://api.github.com/repos/pypa/pip/git/commits{/sha}","comments_url":"https://api.github.com/repos/pypa/pip/comments{/number}","issue_comment_url":"https://api.github.com/repos/pypa/pip/issues/comments{/number}","contents_url":"https://api.github.com/repos/pypa/pip/contents/{+path}","compare_url":"https://api.github.com/repos/pypa/pip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pypa/pip/merges","archive_url":"https://api.github.com/repos/pypa/pip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pypa/pip/downloads","issues_url":"https://api.github.com/repos/pypa/pip/issues{/number}","pulls_url":"https://api.github.com/repos/pypa/pip/pulls{/number}","milestones_url":"https://api.github.com/repos/pypa/pip/milestones{/number}","notifications_url":"https://api.github.com/repos/pypa/pip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pypa/pip/labels{/name}","releases_url":"https://api.github.com/repos/pypa/pip/releases{/id}","created_at":"2011-03-06T14:30:46Z","updated_at":"2015-09-09T15:55:07Z","pushed_at":"2015-09-09T21:09:36Z","git_url":"git://github.com/pypa/pip.git","ssh_url":"git@github.com:pypa/pip.git","clone_url":"https://github.com/pypa/pip.git","svn_url":"https://github.com/pypa/pip","homepage":"https://pip.pypa.io/","size":52932,"stargazers_count":2315,"watchers_count":2315,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":915,"mirror_url":null,"open_issues_count":606,"forks":915,"open_issues":606,"watchers":2315,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/pypa/pip/pulls/3085"},"html":{"href":"https://github.com/pypa/pip/pull/3085"},"issue":{"href":"https://api.github.com/repos/pypa/pip/issues/3085"},"comments":{"href":"https://api.github.com/repos/pypa/pip/issues/3085/comments"},"review_comments":{"href":"https://api.github.com/repos/pypa/pip/pulls/3085/comments"},"review_comment":{"href":"https://api.github.com/repos/pypa/pip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pypa/pip/pulls/3085/commits"},"statuses":{"href":"https://api.github.com/repos/pypa/pip/statuses/3d2f45c344da19b62655e0f3329c888b00919d43"}}}}