From 9b8c86481ce9f476d54797cc4e6d4b963ecca939 Mon Sep 17 00:00:00 2001 From: Yannick PEROUX Date: Thu, 12 Oct 2017 15:52:37 +0200 Subject: [PATCH 1/2] Add regression tests for #887 --- tests/test_pipenv.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index 22c08809..c2355e5c 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -586,6 +586,38 @@ pytest = "==3.1.1" for req in req_list: assert req in c.out + @pytest.mark.lock + @pytest.mark.complex + def test_complex_lock_with_vcs_deps(self): + + with PipenvInstance() as p: + with open(p.pipfile_path, 'w') as f: + contents = """ +[packages] +click = "==6.7" + +[dev-packages] +requests = {git = "https://github.com/requests/requests", egg = "requests"} + """.strip() + f.write(contents) + + c = p.pipenv('install') + assert c.return_code == 0 + lock = p.lockfile + assert 'requests' in lock['develop'] + assert 'click' in lock['default'] + + c = p.pipenv('run pip install -e git+https://github.com/dateutil/dateutil#egg=python_dateutil') + assert c.return_code == 0 + + c = p.pipenv('lock') + assert c.return_code == 0 + lock = p.lockfile + assert 'requests' in lock['develop'] + assert 'click' in lock['default'] + assert 'python_dateutil' not in lock['default'] + assert 'python_dateutil' not in lock['develop'] + @pytest.mark.lock @pytest.mark.requirements @pytest.mark.complex From cd0000011afa4e9c35cdf69a605dfedb55c8cbd2 Mon Sep 17 00:00:00 2001 From: Yannick PEROUX Date: Thu, 12 Oct 2017 15:52:51 +0200 Subject: [PATCH 2/2] Fix #887 --- pipenv/cli.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index 3c8e31fa..031f373e 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -1047,8 +1047,13 @@ def do_lock(verbose=False, system=False, clear=False, pre=False): vcs_deps = convert_deps_to_pip(project.vcs_dev_packages, project, r=False) pip_freeze = delegator.run('{0} freeze'.format(which_pip())).out - for dep in vcs_deps: + if vcs_deps: for line in pip_freeze.strip().split('\n'): + # if the line doesn't match a vcs dependency in the Pipfile, + # ignore it + if not any(dep in line for dep in vcs_deps): + continue + try: installed = convert_deps_from_pip(line) name = list(installed.keys())[0]