Added logic to parse VCS links from a requirements file into it's proper Pipfile format

This commit is contained in:
Erin O'Connell
2017-06-15 17:52:44 -06:00
parent ed209806dc
commit 2a1babae76
+5 -2
View File
@@ -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)