Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Commit

Permalink
Add more informal error message
Browse files Browse the repository at this point in the history
Throw exception when Pipfile parsing malformed in [[source]] section

ChangeId:
pypa#2373
  • Loading branch information
maxkrivich committed Jul 2, 2018
1 parent 46ba42b commit fa51b5e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pipenv/vendor/requirementslib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
except ImportError:
from pathlib2 import Path

from requirementslib.exceptions import RequirementError


VCS_LIST = ("git", "svn", "hg", "bzr")
SCHEME_LIST = ("http://", "https://", "ftp://", "ftps://", "file://")

Expand Down Expand Up @@ -154,6 +157,10 @@ def prepare_pip_source_args(sources, pip_args=None):
if pip_args is None:
pip_args = []
if sources:
allowed_args = ('url', 'verify_ssl', 'name', )
if any(key not in sources for key in allowed_args):
raise RequirementError('Wrong Pipfile format, please check `source`'
'in the file')
# Add the source to pip9.
pip_args.extend(["-i", sources[0]["url"]])
# Trust the host if it's not verified.
Expand Down

0 comments on commit fa51b5e

Please sign in to comment.