diff --git a/AUTHORS.txt b/AUTHORS.txt index 1d195c70d..54bfdbe4c 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -65,6 +65,7 @@ Jonas Nockert Jorge Niedbalski Josh Bronson Josh Hansen +Josh Schneier Kamal Bin Mustafa Kelsey Hightower Kenneth Belitzky diff --git a/CHANGES.txt b/CHANGES.txt index d71b10a79..e0389ef2a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,7 @@ **1.6.0.dev1 (unreleased)** +* Fixed :issue:`798` and :issue:`1060`. `pip install --download` works with vcs links. + (:pull:`1926`) * **BACKWARD INCOMPATIBLE** Dropped support for Python 3.1. diff --git a/pip/req/req_set.py b/pip/req/req_set.py index e7347caf8..0cdc63cc4 100644 --- a/pip/req/req_set.py +++ b/pip/req/req_set.py @@ -507,11 +507,7 @@ class RequirementSet(object): # non-editable vcs urls if is_vcs_url(link): - if only_download: - loc = download_dir - else: - loc = location - unpack_vcs_link(link, loc, only_download) + unpack_vcs_link(link, location, only_download) # file urls elif is_file_url(link): diff --git a/tests/functional/test_install_download.py b/tests/functional/test_install_download.py index 37fa260ae..f4e9c89bc 100644 --- a/tests/functional/test_install_download.py +++ b/tests/functional/test_install_download.py @@ -125,3 +125,17 @@ def test_download_should_skip_existing_files(script): assert Path('scratch') / 'INITools-0.1.tar.gz' not in result.files_created assert script.site_packages / 'initools' not in result.files_created assert script.site_packages / 'openid' not in result.files_created + + +def test_download_vcs_link(script): + """ + It should allow -d flag for vcs links, regression test for issue #798. + """ + result = script.pip( + 'install', '-d', '.', 'git+git://github.com/pypa/pip-test-package.git' + ) + assert ( + Path('scratch') / 'pip-test-package-0.1.1.zip' + in result.files_created + ) + assert script.site_packages / 'piptestpackage' not in result.files_created