From 8b3af75e2fda1f9747e31548894980e4f43b7f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 10 Oct 2022 12:59:26 +0200 Subject: [PATCH] Reorder %pyproject_buildrequires arguments for a nicer usage string Before: usage: %pyproject_buildrequires [-w] [-R] [-e TOXENVS] [-t] [-x EXTRAS] [-N] [REQUIREMENTS.TXT ...] After: usage: %pyproject_buildrequires [-x EXTRAS] [-t] [-e TOXENVS] [-w] [-R] [-N] [REQUIREMENTS.TXT ...] The order was determined as: 0. suppressed options 1. extras, the easiest way to specify test deps (x) 2. tox related options (te) 3. build wheel, as it is provisional (w) 4. "disablers" (RN) 5. varargs are always listed last Previous order was pretty much random. --- pyproject_buildrequires.py | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/pyproject_buildrequires.py b/pyproject_buildrequires.py index 939f79e..01c57f1 100644 --- a/pyproject_buildrequires.py +++ b/pyproject_buildrequires.py @@ -438,40 +438,40 @@ def main(argv): help=argparse.SUPPRESS, # Generate run-time requirements (backwards-compatibility only) ) parser.add_argument( - '-w', '--wheel', action='store_true', default=False, - help=('Generate run-time requirements by building the wheel ' - '(useful for build backends without the prepare_metadata_for_build_wheel hook)'), + '--generate-extras', action='store_true', + help=argparse.SUPPRESS, + ) + parser.add_argument( + '-p', '--python3_pkgversion', metavar='PYTHON3_PKGVERSION', + default="3", help=argparse.SUPPRESS, ) parser.add_argument( '--wheeldir', metavar='PATH', default=None, help=argparse.SUPPRESS, ) - parser.add_argument( - '-R', '--no-runtime', action='store_false', dest='runtime', - help="Don't generate run-time requirements (implied by -N)", - ) - parser.add_argument( - '-e', '--toxenv', metavar='TOXENVS', action='append', - help=('specify tox environments (comma separated and/or repeated)' - '(implies --tox)'), - ) - parser.add_argument( - '-t', '--tox', action='store_true', - help=('generate test tequirements from tox environment ' - '(implies --runtime)'), - ) parser.add_argument( '-x', '--extras', metavar='EXTRAS', action='append', help='comma separated list of "extras" for runtime requirements ' '(e.g. -x testing,feature-x) (implies --runtime, can be repeated)', ) parser.add_argument( - '--generate-extras', action='store_true', - help=argparse.SUPPRESS, + '-t', '--tox', action='store_true', + help=('generate test tequirements from tox environment ' + '(implies --runtime)'), ) parser.add_argument( - '-p', '--python3_pkgversion', metavar='PYTHON3_PKGVERSION', - default="3", help=argparse.SUPPRESS, + '-e', '--toxenv', metavar='TOXENVS', action='append', + help=('specify tox environments (comma separated and/or repeated)' + '(implies --tox)'), + ) + parser.add_argument( + '-w', '--wheel', action='store_true', default=False, + help=('Generate run-time requirements by building the wheel ' + '(useful for build backends without the prepare_metadata_for_build_wheel hook)'), + ) + parser.add_argument( + '-R', '--no-runtime', action='store_false', dest='runtime', + help="Don't generate run-time requirements (implied by -N)", ) parser.add_argument( '-N', '--no-use-build-system', dest='use_build_system',