From: Doug Anderson <dianders@chromium.org>
To: Simon Glass <sjg@chromium.org>
Cc: Alexandru M Stan <amstan@chromium.org>,
Matthias Kaehlcke <mka@chromium.org>,
Sean Anderson <sean.anderson@seco.com>,
Brian Norris <briannorris@chromium.org>,
U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [PATCH v3 3/5] patman: Make most bool arguments BooleanOptionalAction
Date: Sat, 16 Jul 2022 10:46:56 -0700 [thread overview]
Message-ID: <CAD=FV=Xf_T4j9zvUiK_xw5tig3ZgAgvu2aKKHDksoMhFLzVzCQ@mail.gmail.com> (raw)
In-Reply-To: <CAPnjgZ222sKyxwFz-b7gzUm6M4DjjvsafHsGUqeZuxX5vjyF4A@mail.gmail.com>
Hi,
On Sat, Jul 16, 2022 at 4:55 AM Simon Glass <sjg@chromium.org> wrote:
>
> Hi Doug,
>
> On Thu, 7 Jul 2022 at 09:26, Douglas Anderson <dianders@chromium.org> wrote:
> >
> > For boolean arguments it's convenient to be able to specify both the
> > argument and its opposite on the command line. This is especially
> > convenient because you can change the default via the settings file
> > and being able express the opposite can be the only way to override
> > things.
> >
> > Luckily python handles this well--we just need to specify things with
> > BooleanOptionalAction. We'll do that for all options except
> > "full-help" (where it feels silly). This uglifies the help text a
> > little bit but does give maximum flexibility.
> >
> > Signed-off-by: Douglas Anderson <dianders@chromium.org>
> > Tested-by: Brian Norris <briannorris@chromium.org>
> > Reviewed-by: Brian Norris <briannorris@chromium.org>
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> > (no changes since v2)
> >
> > Changes in v2:
> > - Fix doc string for --ignore-bad-tags
> >
> > tools/patman/main.py | 55 ++++++++++++++++++++++----------------------
> > 1 file changed, 28 insertions(+), 27 deletions(-)
>
> Sadly this patch triggers an error:
>
> Traceback (most recent call last):
> File "./tools/patman/patman", line 9, in <module>
> from argparse import ArgumentParser, BooleanOptionalAction
> ImportError: cannot import name 'BooleanOptionalAction' from
> 'argparse' (/usr/lib/python3.8/argparse.py)
>
>
> I've dropped it and the next one. Can you please take a look?
Ugh. I hadn't noticed that it was added in python 3.9. I guess we
don't want to require python 3.9+? Python 3.9 was released October
2020...
-Doug
next prev parent reply other threads:[~2022-07-16 17:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-07 15:23 [PATCH v3 0/5] patman: Small fixes plus remove --no-tree from checkpatch for linux Douglas Anderson
2022-07-07 15:23 ` [PATCH v3 1/5] patman: Fix implicit command inserting Douglas Anderson
2022-07-07 15:23 ` [PATCH v3 2/5] patman: Don't look at sys.argv when parsing settings Douglas Anderson
2022-07-07 15:23 ` [PATCH v3 3/5] patman: Make most bool arguments BooleanOptionalAction Douglas Anderson
2022-07-16 11:55 ` Simon Glass
2022-07-16 17:46 ` Doug Anderson [this message]
2022-07-17 8:17 ` Simon Glass
2022-07-07 15:23 ` [PATCH v3 4/5] patman: By default don't pass "--no-tree" to checkpatch for linux Douglas Anderson
2022-07-07 15:23 ` [PATCH v3 5/5] patman: Take project defaults into account for --help Douglas Anderson
2022-07-17 8:12 ` Simon Glass
2022-07-17 8:12 ` [PATCH v3 2/5] patman: Don't look at sys.argv when parsing settings Simon Glass
2022-07-17 8:12 ` [PATCH v3 1/5] patman: Fix implicit command inserting Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAD=FV=Xf_T4j9zvUiK_xw5tig3ZgAgvu2aKKHDksoMhFLzVzCQ@mail.gmail.com' \
--to=dianders@chromium.org \
--cc=amstan@chromium.org \
--cc=briannorris@chromium.org \
--cc=mka@chromium.org \
--cc=sean.anderson@seco.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).