diff --git a/AUTHORS.txt b/AUTHORS.txt index 1d195c70d9b5d78029acea10fe35bec936945d0c..54bfdbe4c5c0951a83940066c824af7ac22a706d 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 d71b10a791d42ebc3fb333cda545e43c71cab25f..e0389ef2a7a56eae47dbb82acdf4ced155f734e5 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 e7347caf8f8d5c744dbdbde88d7d3b0ca18affb5..0cdc63cc40aeec9b512f939d18a2566437f450c2 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 37fa260aea6271993cacea2bc0990291c0441278..f4e9c89bcd28b02f7c2362084785ffadf4732862 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