From 2a1babae760bd91e38d3c4b3d34aab3fafd51bc0 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Thu, 15 Jun 2017 17:52:44 -0600 Subject: [PATCH] Added logic to parse VCS links from a requirements file into it's proper Pipfile format --- pipenv/cli.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index cc2c452e..945753a4 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -105,11 +105,14 @@ def ensure_pipfile(validate=True): # Pip requires a `PipSession` which is a subclass of requests.Session. # Since we're not making any network calls, it's initialized to nothing. from pip.req.req_file import parse_requirements - reqs = [r.req for r in parse_requirements(project.requirements_location, session='')] + reqs = [r for r in parse_requirements(project.requirements_location, session='')] for package in reqs: if package.name not in BAD_PACKAGES: - project.add_package_to_pipfile(str(package)) + if package.original_link is not None: + project.add_package_to_pipfile(str(package.original_link)) + else: + project.add_package_to_pipfile(str(package.req)) else: click.echo(crayons.yellow('Creating a Pipfile for this project...'), err=True)