Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only strip VCS prefix for URIs with vcs+ patterns #1128

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pipenv/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,9 @@ def convert_deps_from_pip(dep):
req.path = None

# Crop off the git+, etc part.
dependency.setdefault(req.name, {}).update({req.vcs: req.uri[len(req.vcs) + 1:]})
if req.uri.startswith('{0}+'.format(req.vcs)):
req.uri = req.uri[len(req.vcs) + 1:]
dependency.setdefault(req.name, {}).update({req.vcs: req.uri})

# Add --editable, if it's there.
if req.editable:
Expand Down
13 changes: 13 additions & 0 deletions tests/test_pipenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,19 @@ def test_specific_package_environment_markers(self):
c = p.pipenv('run python -c "import requests;"')
assert c.return_code == 1

@pytest.mark.install
@pytest.mark.vcs
@pytest.mark.tablib
def test_install_editable_git_tag(self):
with PipenvInstance() as p:
c = p.pipenv('install -e git+git://github.com/kennethreitz/tablib.git@v0.12.1#egg=tablib')
assert c.return_code == 0
assert 'tablib' in p.pipfile['packages']
assert 'tablib' in p.lockfile['default']
assert 'git' in p.lockfile['default']['tablib']
assert p.lockfile['default']['tablib']['git'] == 'git://github.com/kennethreitz/tablib.git'
assert 'ref' in p.lockfile['default']['tablib']

@pytest.mark.run
@pytest.mark.alt
@pytest.mark.install
Expand Down