diff --git a/pipenv/project.py b/pipenv/project.py index b20c5809..96101849 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -226,13 +226,12 @@ class Project(object): pfile = pipfile.load(self.pipfile_location) lockfile = json.loads(pfile.lock()) - # We may need this later... - # for section in ('default', 'develop'): - # lock_section = lockfile.get(section, {}) + for section in ('default', 'develop'): + lock_section = lockfile.get(section, {}) - # for key in list(lock_section.keys()): - # norm_key = pep423_name(key) - # lockfile[section][norm_key] = lock_section.pop(key) + for key in list(lock_section.keys()): + norm_key = pep423_name(key) + lockfile[section][norm_key] = lock_section.pop(key) return lockfile @@ -397,8 +396,11 @@ class Project(object): # Read and append Pipfile. p = self._pipfile - # Don't re-capitalize file URLs. - if not is_file(package_name): + # Don't re-capitalize file URLs or VCSs. + converted = convert_deps_from_pip(package_name) + converted = converted[[k for k in converted.keys()][0]] + + if not (is_file(package_name) or is_vcs(converted)): package_name = pep423_name(package_name) key = 'dev-packages' if dev else 'packages' diff --git a/tests/test_project.py b/tests/test_project.py index 9c50dcaa..67c3b98c 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -115,7 +115,7 @@ class TestProject(): with open('test_internal_pipfile/Pipfile', 'w') as f: f.write('[[source]]\nurl = \'https://pypi.python.org/simple\'\n' 'verify_ssl = true\n\n\n[packages]\n' - 'Requests = { extras = [\'socks\'] }\nFlask_Auth = \'*\'\n\n\n' + 'requests = { extras = [\'socks\'] }\nFlask_Auth = \'*\'\n\n\n' '[dev-packages]\nclick = \'*\'\nDjango = {git = ' '"https://github.com/django/django.git", ref="1.10"}\n')