Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --bare behavior to sync and clean #3064

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/3041.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--bare now has an effect on clean, and sync's bare option is now used to reduce output.
1 change: 1 addition & 0 deletions pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 9 additions & 7 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down