qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 7/8] python/qapi: move scripts/qapi to python/qemu/qapi


From: Markus Armbruster
Subject: Re: [PATCH 7/8] python/qapi: move scripts/qapi to python/qemu/qapi
Date: Fri, 30 Aug 2024 13:20:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

John Snow <jsnow@redhat.com> writes:

> This is being done for the sake of unifying the linting and static type
> analysis configurations between scripts/qapi and python/qemu/*.
>
> With this change, the qapi module will now be checked by mypy, flake8,
> pylint, isort etc under all python versions from 3.8 through 3.13 under
> a variety of different dependency configurations in the GitLab testing
> pipelines.
>
> The tests can be run locally, as always:
>
>> cd qemu.git/python
>> make check-minreqs
>> make check-tox
>> make check-dev
>
> "check-minreqs" is the must-pass GitLab test.
> "check-tox" is the optional allowed-to-fail GitLab test.
>
> Signed-off-by: John Snow <jsnow@redhat.com>

I don't understand why we have to keep Python code in its own directory
just to get it checked.  We wouldn't do that say for Rust code, would
we?  Anyway, if it's the price of checking, I'll pay[*].

[...]

> diff --git a/scripts/qapi-gen.py b/scripts/qapi-gen.py
> index f3518d29a54..42912c91716 100644
> --- a/scripts/qapi-gen.py
> +++ b/scripts/qapi-gen.py
> @@ -11,9 +11,11 @@
>  execution environment.
>  """
>  
> +import os
>  import sys
>  
> -from qapi import main
> +sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python'))
> +from qemu.qapi import main
>  
>  if __name__ == '__main__':
>      sys.exit(main.main())

Suggest to use the opportunity to rename to just qapi-gen (no .py) and
chmod +x, possibly in a separate patch.

[...]


[*] Grudgingly.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]