All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael Roth" <michael.roth@amd.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Cleber Rosa" <crosa@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH 03/10] qapi: delete un-needed python static analysis configs
Date: Thu, 27 Feb 2025 08:05:10 +0100	[thread overview]
Message-ID: <875xkvvpeh.fsf@pond.sub.org> (raw)
In-Reply-To: <CAFn=p-aPSKn1iL3evY4YKyqUnntQZ+y9Tmh_Bq8-YxwMtWQx-w@mail.gmail.com> (John Snow's message of "Wed, 26 Feb 2025 10:05:54 -0500")

John Snow <jsnow@redhat.com> writes:

> On Wed, Feb 26, 2025 at 2:28 AM Markus Armbruster <armbru@redhat.com> wrote:
>
>> John Snow <jsnow@redhat.com> writes:
>>
>> > The pylint config is being left in place because the settings differ
>> > enough from the python/ directory settings that we need a chit-chat on
>> > how to merge them O:-)
>> >
>> > Everything else can go.
>> >
>> > Signed-off-by: John Snow <jsnow@redhat.com>

[...]

>> > diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini
>> > deleted file mode 100644
>> > index 8109470a031..00000000000
>> > --- a/scripts/qapi/mypy.ini
>> > +++ /dev/null
>> > @@ -1,4 +0,0 @@
>> > -[mypy]
>> > -strict = True
>> > -disallow_untyped_calls = False
>> > -python_version = 3.8
>>
>> python/setup.cfg has:
>>
>>    [mypy]
>>    strict = True
>>    python_version = 3.8
>>    warn_unused_configs = True
>>    namespace_packages = True
>>    warn_unused_ignores = False
>>
>> Can you briefly explain the differences?
>>
>
> warn_unused_configs: Catches config values that aren't actually recognized
> or used. Was helpful once upon a time when re-arranging the Python
> directory to behave like a package to ensure that the conf files were
> working correctly.

Could this be culled now?

Hmm, according to mypy(1), strict implies warn-unused-configs.

The question does not block this patch.

> namespace_packages: Needed for the python/ directory structure (nested
> packages under a namespace, "qemu"). Doesn't impact scripts/qapi at all.
> Read up on PEP420 if you are curious. Details in commit message, see below
> if you're still curious.

mypy(1) makes me suspect this is the default.  If that's true across the
versions we care for, this could be culled.

Also does not block this patch.

> warn_unused_ignores: Needed once upon a time for cross-version mypy support
> where some versions would warn in some cases and others would not. Adding
> an ignore would effectively just invert which versions complained. Probably
> still needed, but it's hard to measure.

Harmless enough.

> python_version: Changes mypy behavior regardless of the invoking python
> interpreter to check the file as if it were to be executed by Python 3.8. I
> actually want to remove this value from setup.cfg but haven't yet. I
> removed it from the python-qemu-qmp repo and never added it for qapi.
> Removing it is actually probably correct as it will catch errors specific
> to various python versions we support, but there are some nits to iron out
> in my neck of the woods. This is a case where scripts/qapi/ is stricter
> than python/ :)
> (Not reasonable to solve for this series.)

Also present in the deleted file, so no change.

> lack of disallow_untyped_calls = False: I think this might be a remnant
> from when we gradually typed qapi; it's evidently no longer needed since
> qapi still checks fine without this affordance. The default under strict is
> True.

Fair enough.

> e941c844e444 (John Snow                   2021-05-27 17:17:05 -0400  79)
> [mypy]
> e941c844e444 (John Snow                   2021-05-27 17:17:05 -0400  80)
> strict = True
> ca056f4499c2 (Paolo Bonzini               2023-05-03 12:48:02 +0200  81)
> python_version = 3.8
> e941c844e444 (John Snow                   2021-05-27 17:17:05 -0400  82)
> warn_unused_configs = True
> 0542a4c95767 (John Snow                   2021-05-27 17:17:06 -0400  83)
> namespace_packages = True
> e7874a50ff3f (John Snow                   2022-05-25 20:09:13 -0400  84)
> warn_unused_ignores = False
>
>
>>
>> python/setup.cfg additionally has a bunch of ignore_missing_imports that
>> don't apply here, as far as I can tell.
>>
>
> Right, that's all stuff for fuse and the interactive qmp shell that use
> untyped dependencies.

Good.

Let's mention the differences in the commit message.  Here's my try:

    Since the previous commit, python/setup.cfg applies to scripts/qapi/
    as well.  Configuration files in scripts/qapi/ override
    python/setup.cfg.

    scripts/qapi/.flake8 and scripts/qapi/.isort.cfg actually match
    python/setup.cfg exactly, and can go.

    The differences between scripts/qapi/mypy.ini and python/setup.cfg
    are harmless: [list the differences, explain why they're harmless as
    long as you can keep it brief, and if not, fall back to "trust me"].
    So scripts/qapi/mypy.ini can go, too.

    The pylint config is being left in place because the settings differ
    enough from the python/ directory settings that we need a chit-chat on
    how to merge them O:-)

With something like that
Reviewed-by: Markus Armbruster <armbru@redhat.com>



  reply	other threads:[~2025-02-27  7:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24  3:37 [PATCH 00/10] qapi: misc testing and doc patches John Snow
2025-02-24  3:37 ` [PATCH 01/10] qapi: update pylintrc config John Snow
2025-02-26  9:19   ` Markus Armbruster
2025-02-24  3:37 ` [PATCH 02/10] python: add qapi static analysis tests John Snow
2025-02-24 12:36   ` Markus Armbruster
2025-02-24 15:07     ` John Snow
2025-02-26  9:29       ` Markus Armbruster
2025-02-26 15:12         ` John Snow
2025-02-24  3:37 ` [PATCH 03/10] qapi: delete un-needed python static analysis configs John Snow
2025-02-24 12:43   ` Markus Armbruster
2025-02-26  7:23     ` Markus Armbruster
2025-02-26  7:27   ` Markus Armbruster
2025-02-26 15:05     ` John Snow
2025-02-27  7:05       ` Markus Armbruster [this message]
2025-02-24  3:37 ` [PATCH 04/10] docs/qapidoc: support header-less freeform sections John Snow
2025-02-24 12:45   ` Markus Armbruster
2025-02-26  9:36     ` Markus Armbruster
2025-02-26 15:28       ` John Snow
2025-02-24  3:37 ` [PATCH 05/10] qapi/parser: adjust info location for doc body section John Snow
2025-02-25  8:15   ` Markus Armbruster
2025-02-24  3:37 ` [PATCH 06/10] docs/qapidoc: remove example section support John Snow
2025-02-26  9:38   ` Markus Armbruster
2025-02-24  3:37 ` [PATCH 07/10] qapi: expand tags to all doc sections John Snow
2025-02-28 12:37   ` Markus Armbruster
2025-02-24  3:37 ` [PATCH 08/10] qapi/schema: add __repr__ to QAPIDoc.Section John Snow
2025-02-24  3:37 ` [PATCH 09/10] qapi/source: allow multi-line QAPISourceInfo advancing John Snow
2025-02-24  3:37 ` [PATCH 10/10] docs: disambiguate cross-references John Snow
2025-02-26 10:09 ` [PATCH 00/10] qapi: misc testing and doc patches Markus Armbruster

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=875xkvvpeh.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=crosa@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.