Merge pull request #3171 from jxltom/fix-uninstall-emtpy-virtualenv

Do not show error for pipenv uninstall --all in a fresh virtuanlenv
This commit is contained in:
Dan Ryan
2018-11-06 22:58:48 -05:00
committed by GitHub
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
Do not show error but success for running pipenv uninstall --all in a fresh virtuanlenv
+8
View File
@@ -1135,10 +1135,18 @@ def do_purge(bare=False, downloads=False, allow_global=False):
# Remove setuptools, pip, etc from targets for removal
to_remove = installed - bad_pkgs
# Skip purging if there is no packages which needs to be removed
if not to_remove:
if not bare:
click.echo("Found 0 installed package, skip purging.")
click.echo(crayons.green("Environment now purged and fresh!"))
return installed
if not bare:
click.echo(
fix_utf8("Found {0} installed package(s), purging…".format(len(to_remove)))
)
command = "{0} uninstall {1} -y".format(
escape_grouped_arguments(which_pip(allow_global=allow_global)),
" ".join(to_remove),