diff --git a/pipenv/cli.py b/pipenv/cli.py index 4839411eec..91abc522f6 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -823,24 +823,6 @@ def update( crayons.white('.', bold=True), ) ) - do_lock( - verbose=verbose, clear=clear, pre=pre, keep_outdated=keep_outdated, pypi_mirror=pypi_mirror - ) - do_sync( - ctx=ctx, - install=install, - dev=dev, - three=three, - python=python, - bare=bare, - dont_upgrade=False, - user=False, - verbose=verbose, - clear=clear, - unused=False, - sequential=sequential, - pypi_mirror=pypi_mirror, - ) else: for package in ([package] + list(more_packages) or []): if package not in project.all_packages: @@ -853,28 +835,23 @@ def update( err=True, ) sys.exit(1) - ensure_lockfile(keep_outdated=project.lockfile_exists, pypi_mirror=pypi_mirror) - # Install the dependencies. - do_install( - package_name=package, - more_packages=more_packages, - dev=dev, - three=three, - python=python, - pypi_mirror=pypi_mirror, - system=system, - lock=True, - ignore_pipfile=False, - skip_lock=False, - verbose=verbose, - requirements=False, - sequential=sequential, - pre=pre, - code=False, - deploy=False, - keep_outdated=True, - selective_upgrade=True, - ) + do_lock( + verbose=verbose, clear=clear, pre=pre, keep_outdated=keep_outdated, pypi_mirror=pypi_mirror + ) + do_sync( + ctx=ctx, + dev=dev, + three=three, + python=python, + bare=bare, + dont_upgrade=False, + user=False, + verbose=verbose, + clear=clear, + unused=False, + sequential=sequential, + pypi_mirror=pypi_mirror, + ) @command( @@ -999,7 +976,6 @@ def sync( do_sync( ctx=ctx, - install=install, dev=dev, three=three, python=python, diff --git a/pipenv/core.py b/pipenv/core.py index 321ec5889a..be67c8f5e0 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -2535,11 +2535,9 @@ def traverse(obj): def do_sync( ctx, - install, dev=False, three=None, python=None, - dry_run=False, bare=False, dont_upgrade=False, user=False, diff --git a/tests/integration/test_pipenv.py b/tests/integration/test_pipenv.py index 3d8a197b5d..00f291e2e7 100644 --- a/tests/integration/test_pipenv.py +++ b/tests/integration/test_pipenv.py @@ -58,3 +58,24 @@ def test_deploy_works(PipenvInstance, pypi): c = p.pipenv('install --deploy') assert c.return_code > 0 + + +@pytest.mark.update +@pytest.mark.lock +def test_update_locks(PipenvInstance, pypi): + + with PipenvInstance(pypi=pypi) as p: + c = p.pipenv('install requests==2.14.0') + assert c.return_code == 0 + with open(p.pipfile_path, 'r') as fh: + pipfile_contents = fh.read() + pipfile_contents = pipfile_contents.replace('==2.14.0', '*') + with open(p.pipfile_path, 'w') as fh: + fh.write(pipfile_contents) + c = p.pipenv('update requests') + assert c.return_code == 0 + assert p.lockfile['default']['requests']['version'] == '==2.18.4' + c = p.pipenv('run pip freeze') + assert c.return_code == 0 + lines = c.out.splitlines() + assert 'requests==2.18.4' in [l.strip() for l in lines]