Repository: kennethreitz/pipenv (python)

Issue:
pipenv does not install gitlint
`gitlint` is not installed when using `--dev --deploy` flags.

Here's my `Pipfile`:

```
[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true


[requires]

python_version = '3.6'


[dev-packages]

django-debug-toolbar = "*"
"pep8-naming" = "*"
"flake8-builtins" = "*"
"flake8-commas" = "*"
"flake8-quotes" = "*"
"flake8-blind-except" = "*"
"flake8-bugbear" = "*"
"flake8-comprehensions" = "*"
"flake8-pep3101" = "*"
pytest = "*"
"pytest-flake8" = "*"
pytest-isort = "*"
pytest-django = "*"
pytest-cov = "*"
gitlint = "*"
pre-commit = "*"
xenon = "*"
radon = "*"
pylint = "*"
pytest-xdist = "*"


[packages]

django = "<1.12"
django-split-settings = "*"
django-axes = "*"
"psycopg2" = "*"
gunicorn = "*"
unipath = "*"
python-decouple = "*"
djangorestframework = "*"
djangorestframework-jwt = "*"
```

Here's the command I am using: `pipenv install --dev --deploy`. The same happens with just `--dev`.

It was working some versions ago.

##### Describe your environment

1. OS Type: macos
1. Python version: `Python 3.6.2` 
1. Pipenv version: `pipenv, version 8.3.1`

##### Expected result

I expect every dependency from `Pipfile` to be installed.

##### Actual result

Here's my `pip freeze`:
```
» pip freeze
apipkg==1.4
aspy.yaml==1.0.0
astroid==1.5.3
attrs==17.2.0
cached-property==1.3.1
certifi==2017.7.27.1
chardet==3.0.4
colorama==0.3.9
coverage==4.4.1
Django==1.11.7
django-axes==2.3.3
django-debug-toolbar==1.8
django-split-settings==0.2.5
djangorestframework==3.7.1
djangorestframework-jwt==1.11.0
execnet==1.5.0
flake8==3.5.0
flake8-blind-except==0.1.1
flake8-bugbear==17.4.0
flake8-builtins==1.0
flake8-commas==0.4.3
flake8-comprehensions==1.4.1
flake8-pep3101==1.1
flake8-polyfill==1.0.1
flake8-quotes==0.12.0
gunicorn==19.7.1
identify==1.0.6
idna==2.6
isort==4.2.15
lazy-object-proxy==1.3.1
mando==0.6.4
mccabe==0.6.1
nodeenv==1.2.0
pep8-naming==0.4.1
pre-commit==1.3.0
psycopg2==2.7.3.2
py==1.4.34
pycodestyle==2.3.1
pyflakes==1.6.0
PyJWT==1.5.3
pylint==1.7.4
pytest==3.2.3
pytest-cache==1.0
pytest-cov==2.5.1
pytest-django==3.1.2
pytest-flake8==0.9.1
pytest-forked==0.2
pytest-isort==0.1.0
pytest-xdist==1.20.1
python-decouple==3.1
pytz==2017.3
PyYAML==3.12
radon==2.1.1
requests==2.18.4
six==1.11.0
sqlparse==0.2.4
Unipath==1.1
urllib3==1.22
virtualenv==15.1.0
wrapt==1.10.11
xenon==0.5.4
```

##### Steps to replicate

1. Copy `Pipfile`
2. `pipenv install --dev`
3. Check for `gitlint` in `pip freeze` and `Pipfile.lock`

Pull request:
Stop matching packages beginning with vcs names
- Fixes #1030

Patch:
diff --git a/pipenv/utils.py b/pipenv/utils.py
index fe9b1a72..cad2960e 100644
--- a/pipenv/utils.py
+++ b/pipenv/utils.py
@@ -771,7 +771,10 @@ def is_vcs(pipfile_entry):
     if hasattr(pipfile_entry, 'keys'):
         return any(key for key in pipfile_entry.keys() if key in VCS_LIST)
     elif isinstance(pipfile_entry, six.string_types):
-        return pipfile_entry.startswith(VCS_LIST)
+        # This syntax is only valid with git
+        if pipfile_entry.startswith('git+git@'):
+            pipfile_entry = pipfile_entry.replace('git+git@', 'git+git://')
+        return bool(requirements.requirement.VCS_REGEX.match(pipfile_entry))
     return False
 
 


Test patch:
diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py
index 53225a20..cd0321b1 100644
--- a/tests/test_pipenv.py
+++ b/tests/test_pipenv.py
@@ -326,9 +326,13 @@ class TestPipenv:
         with PipenvInstance() as p:
             c = p.pipenv('install git+https://github.com/requests/requests.git#egg=requests')
             assert c.return_code == 0
-            assert 'requests' in p.pipfile['packages']
+            # edge case where normal package starts with VCS name shouldn't be flagged as vcs
+            c = p.pipenv('install gitdb2')
+            assert c.return_code == 0
+            assert all(package in p.pipfile['packages'] for package in ['requests', 'gitdb2'])
             assert 'git' in p.pipfile['packages']['requests']
             assert p.lockfile['default']['requests'] == {"git": "https://github.com/requests/requests.git"}
+            assert 'gitdb2' in p.lockfile['default']
 
     @pytest.mark.e
     @pytest.mark.vcs
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 4922d294..4ca48f08 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -124,8 +124,10 @@ class TestUtils:
         ({'some_value': 5, 'other_value': object()}, False),
         ('package', False),
         ('git+https://github.com/requests/requests.git#egg=requests', True),
-        ('git+git@github.com:requests/requests.git#egg=requests', True)
+        ('git+git@github.com:requests/requests.git#egg=requests', True),
+        ('gitdb2', False)
     ])
+    @pytest.mark.vcs
     def test_is_vcs(self, entry, expected):
         assert pipenv.utils.is_vcs(entry) is expected