[PATCH v4 0/6] python: add QAPI and qapidoc et al to python tests

John Snow posted 6 patches 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250512193357.3388514-1-jsnow@redhat.com
Maintainers: John Snow <jsnow@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>, Cleber Rosa <crosa@redhat.com>
docs/sphinx/qapi_domain.py  | 25 ++++++++++++++-----------
docs/sphinx/qapidoc.py      |  5 +++--
python/setup.cfg            |  2 +-
python/tests/minreqs.txt    | 25 +++++++++++++++++++++++++
python/tests/qapi-flake8.sh |  4 ++++
python/tests/qapi-isort.sh  |  6 ++++++
python/tests/qapi-mypy.sh   |  2 ++
python/tests/qapi-pylint.sh |  6 ++++++
scripts/qapi/.flake8        |  3 ---
scripts/qapi/.isort.cfg     |  7 -------
scripts/qapi/backend.py     |  2 ++
scripts/qapi/mypy.ini       |  4 ----
scripts/qapi/pylintrc       |  1 +
13 files changed, 64 insertions(+), 28 deletions(-)
create mode 100755 python/tests/qapi-flake8.sh
create mode 100755 python/tests/qapi-isort.sh
create mode 100755 python/tests/qapi-mypy.sh
create mode 100755 python/tests/qapi-pylint.sh
delete mode 100644 scripts/qapi/.flake8
delete mode 100644 scripts/qapi/.isort.cfg
delete mode 100644 scripts/qapi/mypy.ini
[PATCH v4 0/6] python: add QAPI and qapidoc et al to python tests
Posted by John Snow 6 months ago
Hiya, this series turns on automated linting for scripts/qapi,
docs/sphinx/qapidoc.py and docs/sphinx/qapi_domain.py.

This includes flake8/isort/pylint/mypy for scripts/qapi, but omits mypy
from the Sphinx plugins owing to my inability to strictly type the
extensions given the wide versions of Sphinx we actually support.

[Maybe this will change soon, but it's not true just yet.]

Though I have been using black in my own development, I have not yet
enabled it anywhere automatically. Maybe soon.

V4:
 - Rebase and resend. Pull Request imminent.

V3:
 - Folded in Markus's commit to clean up setup.cfg.

V2:
 - Mostly commit message updates based on Markus's's's review.

John Snow (5):
  qapi: Add some pylint ignores
  docs/qapidoc: linting fixes
  python: update missing dependencies from minreqs
  python: add qapi static analysis tests
  qapi: delete un-needed python static analysis configs

Markus Armbruster (1):
  python: Drop redundant warn_unused_configs = True

 docs/sphinx/qapi_domain.py  | 25 ++++++++++++++-----------
 docs/sphinx/qapidoc.py      |  5 +++--
 python/setup.cfg            |  2 +-
 python/tests/minreqs.txt    | 25 +++++++++++++++++++++++++
 python/tests/qapi-flake8.sh |  4 ++++
 python/tests/qapi-isort.sh  |  6 ++++++
 python/tests/qapi-mypy.sh   |  2 ++
 python/tests/qapi-pylint.sh |  6 ++++++
 scripts/qapi/.flake8        |  3 ---
 scripts/qapi/.isort.cfg     |  7 -------
 scripts/qapi/backend.py     |  2 ++
 scripts/qapi/mypy.ini       |  4 ----
 scripts/qapi/pylintrc       |  1 +
 13 files changed, 64 insertions(+), 28 deletions(-)
 create mode 100755 python/tests/qapi-flake8.sh
 create mode 100755 python/tests/qapi-isort.sh
 create mode 100755 python/tests/qapi-mypy.sh
 create mode 100755 python/tests/qapi-pylint.sh
 delete mode 100644 scripts/qapi/.flake8
 delete mode 100644 scripts/qapi/.isort.cfg
 delete mode 100644 scripts/qapi/mypy.ini

-- 
2.48.1

Re: [PATCH v4 0/6] python: add QAPI and qapidoc et al to python tests
Posted by Markus Armbruster 6 months ago
John Snow <jsnow@redhat.com> writes:

> Hiya, this series turns on automated linting for scripts/qapi,
> docs/sphinx/qapidoc.py and docs/sphinx/qapi_domain.py.
>
> This includes flake8/isort/pylint/mypy for scripts/qapi, but omits mypy
> from the Sphinx plugins owing to my inability to strictly type the
> extensions given the wide versions of Sphinx we actually support.
>
> [Maybe this will change soon, but it's not true just yet.]
>
> Though I have been using black in my own development, I have not yet
> enabled it anywhere automatically. Maybe soon.

You lost my series
Reviewed-by: Markus Armbruster <armbru@redhat.com>

:)
Re: [PATCH v4 0/6] python: add QAPI and qapidoc et al to python tests
Posted by John Snow 6 months ago
On Thu, May 15, 2025 at 4:38 AM Markus Armbruster <armbru@redhat.com> wrote:

> John Snow <jsnow@redhat.com> writes:
>
> > Hiya, this series turns on automated linting for scripts/qapi,
> > docs/sphinx/qapidoc.py and docs/sphinx/qapi_domain.py.
> >
> > This includes flake8/isort/pylint/mypy for scripts/qapi, but omits mypy
> > from the Sphinx plugins owing to my inability to strictly type the
> > extensions given the wide versions of Sphinx we actually support.
> >
> > [Maybe this will change soon, but it's not true just yet.]
> >
> > Though I have been using black in my own development, I have not yet
> > enabled it anywhere automatically. Maybe soon.
>
> You lost my series
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>
> :)


My patches tool broke and I was doing things manually for a bit! I've got
it squared away thanks to Stefan Hajnoczi, and sent a PR out with the
proper message IDs and SOBs.

Thanks!