From 3173673e150907aa77f87e177a86f5091c175e46 Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Wed, 20 Sep 2023 02:27:40 +0200 Subject: [PATCH 1/2] Display non-default debris values in help screen --- pyclean/cli.py | 6 +++++- tests/test_cli.py | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/pyclean/cli.py b/pyclean/cli.py index ecb974f..22ba0e0 100644 --- a/pyclean/cli.py +++ b/pyclean/cli.py @@ -52,7 +52,11 @@ def parse_arguments(): nargs='*', default=argparse.SUPPRESS, choices=debris_choices, help='remove leftovers from popular Python development ' 'tools (may be specified multiple times; ' - 'default: %s)' % ' '.join(debris_default_topics)) + 'optional: all %s; default: %s)' % ( + ' '.join(debris_optional_topics), + ' '.join(debris_default_topics), + ), + ) parser.add_argument('-e', '--erase', metavar='PATTERN', action='extend', nargs='+', default=[], help='delete files or folders matching a globbing ' diff --git a/tests/test_cli.py b/tests/test_cli.py index 13192d6..228a0b1 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -3,6 +3,7 @@ """ import os import platform +import re import sys from importlib import import_module @@ -179,6 +180,22 @@ def test_debris_default_args(): assert args.debris == ['cache', 'coverage', 'package', 'pytest'] +def test_debris_optional_args(): + """ + Does the help screen explain all --debris options? + """ + expected_debris_options_help = ( + '(may be specified multiple times; ' + 'optional: all jupyter mypy ruff tox; ' + 'default: cache coverage package pytest)' + ) + + result = shell('pyclean --help') + normalized_stdout = re.sub(f'{os.linesep} *', ' ', result.stdout) + + assert expected_debris_options_help in normalized_stdout + + def test_debris_all(): """ Does calling `pyclean --debris all` pick all topics? From 8ba101c249bf5f3798987f76ad0c3f16233afacc Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Wed, 20 Sep 2023 03:07:37 +0200 Subject: [PATCH 2/2] Release v2.7.5 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2127a2f..2aa0e8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pyclean" -version = "2.7.4" +version = "2.7.5" description = "Pure Python cross-platform pyclean. Clean up your Python bytecode." readme = "README.rst" license = {file = "LICENSE"}