diff --git a/pipenv/project.py b/pipenv/project.py index 4f65ad53..d4505a20 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -60,15 +60,16 @@ class Project(object): if hasattr(v, 'keys'): # When a vcs url is gven without editable it only appears as a key if is_vcs(v) or is_vcs(k): + # Non-editable VCS entries can't be resolved by piptools if 'editable' not in v: continue else: ps.update({k: v}) else: - if not is_file(v) and not is_file(k) and not is_vcs(v) and not is_vcs(k): + if not is_file(v) and not is_file(k): ps.update({k: v}) else: - if not is_vcs(k) and not is_file(k): + if not is_vcs(k) and not is_file(k) and not is_vcs(v): ps.update({k: v}) return ps diff --git a/pipenv/utils.py b/pipenv/utils.py index 2047bddd..94b6fdec 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -496,6 +496,7 @@ def convert_deps_from_pip(dep): req = [r for r in requirements.parse(dep)][0] extras = {'extras': req.extras} + # File installs. if (req.uri or (os.path.exists(req.path) if req.path else False) or os.path.exists(req.name)) and not req.vcs: @@ -517,8 +518,8 @@ def convert_deps_from_pip(dep): if req.editable: dependency[req.name].update({'editable': True}) - # VCS Installs. - if req.vcs: + # VCS Installs. Extra check for unparsed git over SSH + if req.vcs or is_vcs(req.path): if req.name is None: raise ValueError('pipenv requires an #egg fragment for version controlled ' 'dependencies. Please install remote dependency ' @@ -528,6 +529,12 @@ def convert_deps_from_pip(dep): if req.extras: dependency[req.name] = extras + # Set up this requirement as a proper VCS requirement if it was not + if not req.vcs and req.path.startswith(VCS_LIST): + req.vcs = [vcs for vcs in VCS_LIST if req.path.startswith(vcs)][0] + req.uri = '{0}'.format(req.path) + req.path = None + # Crop off the git+, etc part. dependency.setdefault(req.name, {}).update({req.vcs: req.uri[len(req.vcs) + 1:]})