Merge pull request #1173 from techalchemy/bugfix/1172-dont-install-dev-packages

Bugfix/1172 dont install dev packages
This commit is contained in:
Nate Prewitt
2017-12-06 20:20:07 -08:00
committed by GitHub
3 changed files with 29 additions and 0 deletions
+1
View File
@@ -1,3 +1,4 @@
- Fixed regression causing development packages to always be installed
9.0.0:
- Fixed bug where packages beginning with vcs names (e.g. git) weren't installed correctly.
- Fixed url parsing for <vcs>+<vcs>:// style urls.
+2
View File
@@ -998,6 +998,8 @@ def merge_deps(file_dict, project, dev=False, requirements=False, ignore_hashes=
if not file_dict[section] or section_name not in ('dev-packages', 'packages', 'default', 'develop'):
continue
is_dev = section_name in ('dev-packages', 'develop')
if is_dev and not dev:
continue
if ignore_hashes:
for k, v in file_dict[section]:
+26
View File
@@ -243,6 +243,32 @@ class TestPipenv:
c = p.pipenv('run python -m requests.help')
assert c.return_code == 0
@pytest.mark.dev
@pytest.mark.install
def test_install_without_dev(self):
"""Ensure that running `pipenv install` doesn't install dev packages"""
with PipenvInstance() as p:
with open(p.pipfile_path, 'w') as f:
contents = """
[packages]
tablib = "*"
[dev-packages]
records = "*"
""".strip()
f.write(contents)
c = p.pipenv('install')
assert c.return_code == 0
assert 'tablib' in p.pipfile['packages']
assert 'records' in p.pipfile['dev-packages']
assert 'tablib' in p.lockfile['default']
assert 'records' in p.lockfile['develop']
c = p.pipenv('run python -c "import records"')
assert c.return_code != 0
c = p.pipenv('run python -c "import tablib"')
assert c.return_code == 0
@pytest.mark.run
@pytest.mark.uninstall
def test_uninstall(self):