From 7595350a131dc4dc7a589ac6b65dab0af382b33c Mon Sep 17 00:00:00 2001 From: jacrotts Date: Thu, 18 Oct 2018 22:33:24 -0500 Subject: [PATCH 1/4] Implement some behavior for --bare in sync and clean, and add bare as an option to do_clean in cli.py --- pipenv/cli/command.py | 1 + pipenv/core.py | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index 1ce9fee944..aeeeda31be 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -590,6 +590,7 @@ def sync( @cli.command(short_help="Uninstalls all packages not specified in Pipfile.lock.") +@option("--bare", is_flag=True, default=False, help="Minimal output.") @option("--dry-run", is_flag=True, default=False, help="Just output unneeded packages.") @verbose_option @three_option diff --git a/pipenv/core.py b/pipenv/core.py index ca37bd5c0c..a4f3e8920e 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -2513,8 +2513,9 @@ def do_sync( deploy=deploy, system=system, ) - requirements_dir.cleanup() - click.echo(crayons.green("All dependencies are now up-to-date!")) + requirements_dir.cleanup() + if not bare: + click.echo(crayons.green("All dependencies are now up-to-date!")) def do_clean(ctx, three=None, python=None, dry_run=False, bare=False, pypi_mirror=None): @@ -2543,14 +2544,15 @@ def do_clean(ctx, three=None, python=None, dry_run=False, bare=False, pypi_mirro )] failure = False for apparent_bad_package in installed_package_names: - if dry_run: + if dry_run and not bare: click.echo(apparent_bad_package) else: - click.echo( - crayons.white( - "Uninstalling {0}…".format(repr(apparent_bad_package)), bold=True + if not bare: + click.echo( + crayons.white( + "Uninstalling {0}…".format(repr(apparent_bad_package)), bold=True + ) ) - ) # Uninstall the package. c = delegator.run( "{0} uninstall {1} -y".format(which_pip(), apparent_bad_package) From 14e910568b8084adb6b96902b085232a24df8096 Mon Sep 17 00:00:00 2001 From: jacrotts Date: Thu, 18 Oct 2018 23:24:36 -0500 Subject: [PATCH 2/4] Add news fragment for 3041.feature --- news/3041.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/3041.feature diff --git a/news/3041.feature b/news/3041.feature new file mode 100644 index 0000000000..edbf7fb064 --- /dev/null +++ b/news/3041.feature @@ -0,0 +1 @@ +--bare now has effect on sync and clean. From ceaa3450305fcf075598066661b46a42e7bbf5d7 Mon Sep 17 00:00:00 2001 From: jacrotts Date: Fri, 19 Oct 2018 00:20:04 -0500 Subject: [PATCH 3/4] Change news fragment to better reflect changes to sync --- news/3041.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/3041.feature b/news/3041.feature index edbf7fb064..4a72e21641 100644 --- a/news/3041.feature +++ b/news/3041.feature @@ -1 +1 @@ ---bare now has effect on sync and clean. +--bare now has an effect on clean, and use sync's bare option to reduce output. From a1c046446d7396980dc95616925db356d0d0298a Mon Sep 17 00:00:00 2001 From: jacrotts Date: Fri, 19 Oct 2018 00:36:40 -0500 Subject: [PATCH 4/4] Edit a word in news fragment --- news/3041.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/3041.feature b/news/3041.feature index 4a72e21641..79a1d5de17 100644 --- a/news/3041.feature +++ b/news/3041.feature @@ -1 +1 @@ ---bare now has an effect on clean, and use sync's bare option to reduce output. +--bare now has an effect on clean, and sync's bare option is now used to reduce output.