mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Added logic to parse VCS links from a requirements file into it's proper Pipfile format
This commit is contained in:
+5
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user