qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/15] python: absorb scripts/qmp/qom-* tooling
@ 2020-10-21 18:51 John Snow
  2020-10-21 18:51 ` [PATCH 01/15] python/qmp: Add qom script rewrites John Snow
                   ` (15 more replies)
  0 siblings, 16 replies; 24+ messages in thread
From: John Snow @ 2020-10-21 18:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Markus Armbruster, John Snow, Eduardo Habkost, Cleber Rosa

Based-on: <20201020193555.1493936-1-jsnow@redhat.com>
          [PATCH v3 00/15] python: create installable package

This is a bit of a demonstration of the direction I want to take our
python tooling, and how it *might* work.

By moving items from ./scripts/*.py over to ./python/qemu/* somewhere,
they can be checked with the same isort/flake8/pylint/mypy tooling as
everything else. This will help prevent regressions.

I would like to, over time, move all applicable python scripts from
./scripts to ./python. That will be a long, gradual stream of changes,
but the more we do it, the better off we'll be for these tools.

Reviewer notes:

- I just rewrote qom-xxx entirely, though it is based on the original
  scripts. Doing it brick by brick was too slow.

- I added a symlink to the qom-fuse file under the python/ tree so I
  could check it with the usual linters. This causes some future
  knowledge to bleed through in a few places; notably I update the
  python setup.cfg several times in the middle of the series where it
  doesn't seem like that should have an effect.

- qom-fuse disappears from the tree for a single commit, but that
  preserves git-blame history. Best I could do.

John Snow (15):
  python/qmp: Add qom script rewrites
  python/qmp: add qom script entry points
  scripts/qmp: redirect qom-xxx scripts to python/qemu/qmp/
  scripts/qom-fuse: apply isort rules
  scripts/qom-fuse: apply flake8 rules
  python: Add 'fh' to known-good variable names
  scripts/qom-fuse: Apply pylint rules
  scripts/qom-fuse: Add docstrings
  scripts/qom-fuse: Convert to QOMCommand
  scripts/qom-fuse: use QOMCommand.qom_list()
  scripts/qom-fuse: ensure QOMFuse.read always returns bytes
  scripts/qom-fuse: add static type hints
  scripts/qom-fuse: move to python/qemu/qmp/qom_fuse.py
  scripts/qom-fuse: add redirection shim to python/qemu/qmp/qom-fuse.py
  python: add fuse command to 'qom' tools

 python/qemu/qmp/qom.py        | 217 ++++++++++++++++++++++++++++++++++
 python/qemu/qmp/qom_common.py | 153 ++++++++++++++++++++++++
 python/qemu/qmp/qom_fuse.py   | 207 ++++++++++++++++++++++++++++++++
 python/setup.cfg              |  24 +++-
 scripts/qmp/qom-fuse          | 144 +---------------------
 scripts/qmp/qom-get           |  66 +----------
 scripts/qmp/qom-list          |  63 +---------
 scripts/qmp/qom-set           |  63 +---------
 scripts/qmp/qom-tree          |  74 +-----------
 9 files changed, 618 insertions(+), 393 deletions(-)
 create mode 100644 python/qemu/qmp/qom.py
 create mode 100644 python/qemu/qmp/qom_common.py
 create mode 100644 python/qemu/qmp/qom_fuse.py

-- 
2.26.2




^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-11-04  1:33 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-21 18:51 [PATCH 00/15] python: absorb scripts/qmp/qom-* tooling John Snow
2020-10-21 18:51 ` [PATCH 01/15] python/qmp: Add qom script rewrites John Snow
2020-10-21 18:51 ` [PATCH 02/15] python/qmp: add qom script entry points John Snow
2020-10-24 20:00   ` Philippe Mathieu-Daudé
2020-10-21 18:51 ` [PATCH 03/15] scripts/qmp: redirect qom-xxx scripts to python/qemu/qmp/ John Snow
2020-10-24 19:59   ` Philippe Mathieu-Daudé
2020-10-21 18:51 ` [PATCH 04/15] scripts/qom-fuse: apply isort rules John Snow
2020-10-24 19:58   ` Philippe Mathieu-Daudé
2020-10-21 18:51 ` [PATCH 05/15] scripts/qom-fuse: apply flake8 rules John Snow
2020-10-21 18:51 ` [PATCH 06/15] python: Add 'fh' to known-good variable names John Snow
2020-10-21 18:52 ` [PATCH 07/15] scripts/qom-fuse: Apply pylint rules John Snow
2020-10-24 19:57   ` Philippe Mathieu-Daudé
2020-10-21 18:52 ` [PATCH 08/15] scripts/qom-fuse: Add docstrings John Snow
2020-10-21 18:52 ` [PATCH 09/15] scripts/qom-fuse: Convert to QOMCommand John Snow
2020-10-21 18:52 ` [PATCH 10/15] scripts/qom-fuse: use QOMCommand.qom_list() John Snow
2020-10-21 18:52 ` [PATCH 11/15] scripts/qom-fuse: ensure QOMFuse.read always returns bytes John Snow
2020-10-24 19:55   ` Philippe Mathieu-Daudé
2020-10-21 18:52 ` [PATCH 12/15] scripts/qom-fuse: add static type hints John Snow
2020-10-21 18:52 ` [PATCH 13/15] scripts/qom-fuse: move to python/qemu/qmp/qom_fuse.py John Snow
2020-10-24 19:56   ` Philippe Mathieu-Daudé
2020-10-21 18:52 ` [PATCH 14/15] scripts/qom-fuse: add redirection shim to python/qemu/qmp/qom-fuse.py John Snow
2020-10-24 19:56   ` Philippe Mathieu-Daudé
2020-10-21 18:52 ` [PATCH 15/15] python: add fuse command to 'qom' tools John Snow
2020-11-04  0:38 ` [PATCH 00/15] python: absorb scripts/qmp/qom-* tooling John Snow

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).