add update back, sorta

Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
2018-02-28 09:33:17 -05:00
parent db1874c170
commit 1d021cd3ff
2 changed files with 39 additions and 0 deletions
+38
View File
@@ -315,6 +315,43 @@ def check(three=None, python=False, system=False, unused=False, style=False, arg
core.do_check(three=three, python=python, system=system, unused=unused, args=args)
@click.command(short_help="Runs lock, then sync.")
@click.option('--three/--two', is_flag=True, default=None, help="Use Python 3/2 when creating virtualenv.")
@click.option('--python', default=False, nargs=1, help="Specify which version of Python virtualenv should use.")
@click.option('--system', is_flag=True, default=False, help="Use system Python.")
@click.option('--verbose', '-v', is_flag=True, default=False, help="Verbose mode.", callback=setup_verbose)
@click.option('--dev', '-d', is_flag=True, default=False, help="Install package(s) in [dev-packages].")
@click.option('--clear', is_flag=True, default=False, help="Clear the dependency cache.")
@click.option('--bare', is_flag=True, default=False, help="Minimal output.")
@click.option('--pre', is_flag=True, default=False, help=u"Allow prereleases.")
@click.option('--keep-outdated', is_flag=True, default=False, help=u"Keep outdated dependencies from being updated in Pipfile.lock.")
@click.option('--sequential', is_flag=True, default=False, help="Install dependencies one-at-a-time, instead of concurrently.")
@click.pass_context
def update(ctx, three=None, python=False, system=False, verbose=False, clear=False, keep_outdated=False, pre=False, dev=False, bare=False, sequential=False):
from . import core
click.echo('{0} {1} {2} {3}{4}'.format(
crayons.white('Running', bold=True),
crayons.red('$ pipenv lock', bold=True),
crayons.white('then', bold=True),
crayons.red('$ pipenv sync', bold=True),
crayons.white('.', bold=True),
))
# Load the --pre settings from the Pipfile.
if not pre:
pre = core.project.settings.get('pre')
core.do_lock(verbose=verbose, clear=clear, pre=pre, keep_outdated=keep_outdated)
core.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
)
@click.command(short_help=u"Displays currentlyinstalled dependency graph information.")
@click.option('--bare', is_flag=True, default=False, help="Minimal output.")
@click.option('--json', is_flag=True, default=False, help="Output JSON.")
@@ -399,6 +436,7 @@ cli.add_command(check)
cli.add_command(clean)
cli.add_command(shell)
cli.add_command(run)
cli.add_command(update)
cli.add_command(run_open)
+1
View File
@@ -1550,6 +1550,7 @@ def format_help(help):
help = help.replace(' shell', str(crayons.yellow(' shell', bold=True)))
help = help.replace(' sync', str(crayons.green(' sync', bold=True)))
help = help.replace(' uninstall', str(crayons.magenta(' uninstall', bold=True)))
help = help.replace(' update', str(crayons.green(' update', bold=True)))
additional_help = """
Usage Examples: