Skip to contentSkip to conversation

RFC: Drop qemu.qmp from qemu.git

RFC PATCH In review John Snow 2 participants 25 messages Oct 28, 2025 – Nov 3, 2025 Arm/Amlogic Meson SoC support

lore
Share & tools
lore

John Snow

author
#0 lore raw

cover RFC: Drop qemu.qmp from qemu.git

This is an RFC, there's definitely a ton of nits here to smooth over, but I need help.

1) The custom target I added to invoke the mkvenv ensure_group command to install test deps uses a junk output target that isn't actually pointed at the blank group file that mkvenv creates, because it's in another directory and meson doesn't like allowing you to specify targets in other directories. I'm not sure what the best way to fix this is...

2) I only made iotests depend on this new custom target, because it was easy to do. I was not immediately sure what the correct way to make the functests depend on this new target was, so that needs adjusted.

3) I did not remove the legacy "check-venv" target yet as with this patchset I have split apart the testing dependencies into the core dependencies and the functional dependencies. Ideally, "check-venv" is removed and we add a second custom target to meson that replaces this legacy target.

4) I have so far not made any provisions to allow running iotest's check script from outside of the build system, but I am hoping it won't be too difficult to achieve ...

5) There's likely a bunch of python tests that are now yapping and yelping after I so cruelly removed one of our libraries from out of the tree, I will smooth those over before the final push, but I can work on this in parallel while I wait for feedback and advice on the above items.

John Snow (10):
python/mkvenv: ensure HAVE_LIB variables are actually constants python/qapi: Add an ignore for Pylint 4.x python/mkvenv: create timestamp file for each group "ensured" python/mkvenv: bump 'qemu.qmp' dependency for testdeps python/mkvenv: rename 'testdeps' to 'functests' python/mkvenv: add "tests" dependency group
meson: create meson custom target for python test dependencies
meson: make iotests depend on pyvent_test_deps
python: quote dotted dependency keys
python: delete qemu.qmp

 .gitlab-ci.d/buildtest.yml                    |    1 +
 python/qemu/qmp/__init__.py                   |   60 -
 python/qemu/qmp/error.py                      |   53 -
 python/qemu/qmp/events.py                     |  751 -----------
 python/qemu/qmp/legacy.py                     |  339 -----
 python/qemu/qmp/message.py                    |  217 ----
 python/qemu/qmp/models.py                     |  146 ---
 python/qemu/qmp/protocol.py                   | 1101 -----------------
 python/qemu/qmp/py.typed                      |    0
 python/qemu/qmp/qmp_client.py                 |  732 -----------
 python/qemu/qmp/qmp_shell.py                  |  689 -----------
 python/qemu/qmp/qmp_tui.py                    |  665 ----------
 python/qemu/qmp/util.py                       |  150 ---
 python/qemu/utils/qom_fuse.py                 |    1 -
 python/scripts/mkvenv.py                      |   30 +-
 python/scripts/vendor.py                      |    2 +
 python/setup.cfg                              |   32 +-
 python/tests/minreqs.txt                      |    8 +-
 python/tests/protocol.py                      |  596 ---------
 python/wheels/qemu_qmp-0.0.5-py3-none-any.whl |  Bin 0 -> 72263 bytes
 pythondeps.toml                               |    7 +-
 scripts/qapi/introspect.py                    |    2 +-
 tests/Makefile.include                        |    2 +-
 tests/meson.build                             |   15 +
 tests/qemu-iotests/meson.build                |    2 +-
 25 files changed, 55 insertions(+), 5546 deletions(-)
 delete mode 100644 python/qemu/qmp/__init__.py
 delete mode 100644 python/qemu/qmp/error.py
 delete mode 100644 python/qemu/qmp/events.py
 delete mode 100644 python/qemu/qmp/legacy.py
 delete mode 100644 python/qemu/qmp/message.py
 delete mode 100644 python/qemu/qmp/models.py
 delete mode 100644 python/qemu/qmp/protocol.py
 delete mode 100644 python/qemu/qmp/py.typed
 delete mode 100644 python/qemu/qmp/qmp_client.py
 delete mode 100644 python/qemu/qmp/qmp_shell.py
 delete mode 100644 python/qemu/qmp/qmp_tui.py
 delete mode 100644 python/qemu/qmp/util.py
 delete mode 100644 python/tests/protocol.py
 create mode 100644 python/wheels/qemu_qmp-0.0.5-py3-none-any.whl
Signature · 1 line
2.51.0
author
#1 lore raw

RFC PATCH 1/10 python/mkvenv: ensure HAVE_LIB variables are actually constants

Pylint 4.x has refined checking for variable names that behave as constants vs ones that do not; unfortunately our tricky import machinery is perceived as these variables being re-assigned.

Add a temporary variable with an underscore and assign to the global constants precisely once to alleviate this new nag message.

---
 python/scripts/mkvenv.py | 24 ++++++++++++++++--------
 python/setup.cfg         |  1 +
 2 files changed, 17 insertions(+), 8 deletions(-)
python/scripts/mkvenv.py +16 -8
index 9aed266df1b..a064709e6ce 100644
@@ -92,7 +92,7 @@
 # Try to load distlib, with a fallback to pip's vendored version.
 # HAVE_DISTLIB is checked below, just-in-time, so that mkvenv does not fail
 # outside the venv or before a potential call to ensurepip in checkpip().
-HAVE_DISTLIB = True
+_import_ok = True
 try:
     import distlib.scripts
 except ImportError:
@@ -102,11 +102,13 @@
         from pip._vendor import distlib
         import pip._vendor.distlib.scripts  # noqa, pylint: disable=unused-import
     except ImportError:
-        HAVE_DISTLIB = False
+        _import_ok = False
+
+HAVE_DISTLIB = _import_ok
 
 # pip 25.2 does not vendor distlib.version, but it uses vendored
 # packaging.version
-HAVE_DISTLIB_VERSION = True
+_import_ok = True
 try:
     import distlib.version  # pylint: disable=ungrouped-imports
 except ImportError:
@@ -114,9 +116,11 @@
         # pylint: disable=unused-import,ungrouped-imports
         import pip._vendor.distlib.version  # noqa
     except ImportError:
-        HAVE_DISTLIB_VERSION = False
+        _import_ok = False
 
-HAVE_PACKAGING_VERSION = True
+HAVE_DISTLIB_VERSION = _import_ok
+
+_import_ok = True
 try:
     # Do not bother importing non-vendored packaging, because it is not
     # in stdlib.
@@ -125,20 +129,24 @@
     import pip._vendor.packaging.requirements  # noqa
     import pip._vendor.packaging.version  # noqa
 except ImportError:
-    HAVE_PACKAGING_VERSION = False
+    _import_ok = False
+
+HAVE_PACKAGING_VERSION = _import_ok
 
 
 # Try to load tomllib, with a fallback to tomli.
 # HAVE_TOMLLIB is checked below, just-in-time, so that mkvenv does not fail
 # outside the venv or before a potential call to ensurepip in checkpip().
-HAVE_TOMLLIB = True
+_import_ok = True
 try:
     import tomllib
 except ImportError:
     try:
         import tomli as tomllib
     except ImportError:
-        HAVE_TOMLLIB = False
+        _import_ok = False
+
+HAVE_TOMLLIB = _import_ok
 
 # Do not add any mandatory dependencies from outside the stdlib:
 # This script *must* be usable standalone!
python/setup.cfg +1 -0
index d7f5dc7bafe..f40f11396c9 100644
@@ -159,6 +159,7 @@ good-names=i,
            c,   # for c in string: ...
            T,   # for TypeVars. See pylint#3401
            SocketAddrT,  # Not sure why this is invalid.
+           _import_ok,  # For mkvenv import trickery and compatibility pre-4.x
 
 [pylint.similarities]
 # Ignore imports when computing similarities.
Signature · 1 line
2.51.0
Reviewed-by on v1 1/10
#2 lore raw

Re: [PATCH RFC 01/10] python/mkvenv: ensure HAVE_LIB variables are actually constants

Quoted 4 lines · John Snow

Pylint 4.x has refined checking for variable names that behave as constants vs ones that do not; unfortunately our tricky import machinery is perceived as these variables being re-assigned.

Quoted 8 lines

Add a temporary variable with an underscore and assign to the global constants precisely once to alleviate this new nag message.

---
  python/scripts/mkvenv.py | 24 ++++++++++++++++--------
  python/setup.cfg         |  1 +
  2 files changed, 17 insertions(+), 8 deletions(-)

...> diff --git a/python/setup.cfg b/python/setup.cfg

python/setup.cfg good-names=i, · line 162

Quoted 8 lines

index d7f5dc7bafe..f40f11396c9 100644

python/setup.cfg +1 -0
@@ -159,6 +159,7 @@ good-names=i,
             c,   # for c in string: ...
             T,   # for TypeVars. See pylint#3401
             SocketAddrT,  # Not sure why this is invalid.
+           _import_ok,  # For mkvenv import trickery and compatibility pre-4.x

Out of curiosity, is it really necessary to add _import_ok to good-names, or is this just for being on the safe side for future changes in pylint?

Anyway,

author
#3 lore raw

Re: [PATCH RFC 01/10] python/mkvenv: ensure HAVE_LIB variables are actually constants

Quoted 25 lines · Thomas Huth
Quoted 4 lines · John Snow

Pylint 4.x has refined checking for variable names that behave as constants vs ones that do not; unfortunately our tricky import machinery is perceived as these variables being re-assigned.

Quoted 8 lines

Add a temporary variable with an underscore and assign to the global constants precisely once to alleviate this new nag message.

---
  python/scripts/mkvenv.py | 24 ++++++++++++++++--------
  python/setup.cfg         |  1 +
  2 files changed, 17 insertions(+), 8 deletions(-)

...> diff --git a/python/setup.cfg b/python/setup.cfg

python/setup.cfg good-names=i, · line 162

Quoted 8 lines

index d7f5dc7bafe..f40f11396c9 100644

python/setup.cfg +1 -0
@@ -159,6 +159,7 @@ good-names=i,
             c,   # for c in string: ...
             T,   # for TypeVars. See pylint#3401
             SocketAddrT,  # Not sure why this is invalid.
+           _import_ok,  # For mkvenv import trickery and compatibility

pre-4.x

Quoted 4 lines

Out of curiosity, is it really necessary to add _import_ok to good-names, or
is this just for being on the safe side for future changes in pylint?

It's for the older versions... they still think it's a constant and want it uppercased.

Quoted 4 lines

Anyway,

author
#4 lore raw

RFC PATCH 2/10 python/qapi: Add an ignore for Pylint 4.x

In reply to John Snow

Pylint 4.x wants to use a different regex for _Stub for some reason; just silence this.

---
 scripts/qapi/introspect.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/qapi/introspect.py +1 -1
index 89ee5d5f176..7e28de2279a 100644
@@ -59,7 +59,7 @@
 #
 # Sadly, mypy does not support recursive types; so the _Stub alias is used to
 # mark the imprecision in the type model where we'd otherwise use JSONValue.
-_Stub = Any
+_Stub = Any  # pylint: disable=invalid-name
 _Scalar = Union[str, bool, None]
 _NonScalar = Union[Dict[str, _Stub], List[_Stub]]
 _Value = Union[_Scalar, _NonScalar]
Signature · 1 line
2.51.0
Reviewed-by on v1 2/10
#5 lore raw

Re: [PATCH RFC 02/10] python/qapi: Add an ignore for Pylint 4.x

Quoted 13 lines · John Snow

Pylint 4.x wants to use a different regex for _Stub for some reason; just silence this.

---
  scripts/qapi/introspect.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
scripts/qapi/introspect.py +0 -0
index 89ee5d5f176..7e28de2279a 100644

scripts/qapi/introspect.py line 65

Quoted 8 lines
scripts/qapi/introspect.py +1 -1
@@ -59,7 +59,7 @@
  #
  # Sadly, mypy does not support recursive types; so the _Stub alias is used to
  # mark the imprecision in the type model where we'd otherwise use JSONValue.
-_Stub = Any
+_Stub = Any  # pylint: disable=invalid-name
  _Scalar = Union[str, bool, None]
  _NonScalar = Union[Dict[str, _Stub], List[_Stub]]
  _Value = Union[_Scalar, _NonScalar]

Alternatively, rename it to "_stub" ?

Anyway,

author
#6 lore raw

Re: [PATCH RFC 02/10] python/qapi: Add an ignore for Pylint 4.x

Quoted 18 lines · Thomas Huth
Quoted 13 lines · John Snow

Pylint 4.x wants to use a different regex for _Stub for some reason; just silence this.

---
  scripts/qapi/introspect.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
scripts/qapi/introspect.py +0 -0
index 89ee5d5f176..7e28de2279a 100644

scripts/qapi/introspect.py line 60

Quoted 2 lines
scripts/qapi/introspect.py +0 -0
@@ -59,7 +59,7 @@
  #
  # Sadly, mypy does not support recursive types; so the _Stub alias is

used to

scripts/qapi/introspect.py line 61

Quoted 1 line
scripts/qapi/introspect.py +0 -0
  # mark the imprecision in the type model where we'd otherwise use
Quoted 9 lines

JSONValue.

scripts/qapi/introspect.py line 65

Quoted 5 lines
scripts/qapi/introspect.py +1 -1
-_Stub = Any
+_Stub = Any  # pylint: disable=invalid-name
  _Scalar = Union[str, bool, None]
  _NonScalar = Union[Dict[str, _Stub], List[_Stub]]
  _Value = Union[_Scalar, _NonScalar]

Alternatively, rename it to "_stub" ?

Well, it's a "type" and it should match the others, ... I don't actually know why it is deciding to whine about this and had bigger fish to fry.

Quoted 4 lines

Anyway,

author
#7 lore raw

RFC PATCH 3/10 python/mkvenv: create timestamp file for each group "ensured"

In reply to John Snow
---
 python/scripts/mkvenv.py | 6 ++++++
 1 file changed, 6 insertions(+)
python/scripts/mkvenv.py +6 -0
index a064709e6ce..a22e3ee3394 100644
@@ -838,6 +838,12 @@ def ensure_group(
             raise Ouch(result[0])
         raise SystemExit(f"\n{result[0]}\n\n")
 
+    if inside_a_venv():
+        for group in groups:
+            path = Path(sys.prefix).joinpath(f"{group}.group")
+            with open(path, "w", encoding="UTF8"):
+                pass
+
 
 def post_venv_setup() -> None:
     """
Signature · 1 line
2.51.0
#8 lore raw

Re: [PATCH RFC 03/10] python/mkvenv: create timestamp file for each group "ensured"

Missing patch description - what is this good for?

Thomas

Quoted 22 lines · John Snow
---
  python/scripts/mkvenv.py | 6 ++++++
  1 file changed, 6 insertions(+)
python/scripts/mkvenv.py +6 -0
index a064709e6ce..a22e3ee3394 100644
@@ -838,6 +838,12 @@ def ensure_group(
              raise Ouch(result[0])
          raise SystemExit(f"\n{result[0]}\n\n")
 
+    if inside_a_venv():
+        for group in groups:
+            path = Path(sys.prefix).joinpath(f"{group}.group")
+            with open(path, "w", encoding="UTF8"):
+                pass
+
 
  def post_venv_setup() -> None:
      """
author
#9 lore raw

Re: [PATCH RFC 03/10] python/mkvenv: create timestamp file for each group "ensured"

Quoted 3 lines · Thomas Huth

Missing patch description - what is this good for?

At the moment, truthfully, nothing!

The intent was a timestamp file for each group so scripts don't need to reinstall groups post-config time.

Basically a replacement for check-venv's timestamp file.

Quoted 27 lines

Thomas

Quoted 22 lines · John Snow
---
  python/scripts/mkvenv.py | 6 ++++++
  1 file changed, 6 insertions(+)
python/scripts/mkvenv.py +6 -0
index a064709e6ce..a22e3ee3394 100644
@@ -838,6 +838,12 @@ def ensure_group(
              raise Ouch(result[0])
          raise SystemExit(f"\n{result[0]}\n\n")
 
+    if inside_a_venv():
+        for group in groups:
+            path = Path(sys.prefix).joinpath(f"{group}.group")
+            with open(path, "w", encoding="UTF8"):
+                pass
+
 
  def post_venv_setup() -> None:
      """
author
#10 lore raw

RFC PATCH 4/10 python/mkvenv: bump 'qemu.qmp' dependency for testdeps

In reply to John Snow

Firstly, there is a new v0.0.5 that should be used instead of v0.0.3.

Secondly, the use of a period in the key name does not behave as expected when installing and checking for dependencies, so use underscore instead - which does indeed resolve to the same package.

---
 pythondeps.toml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
pythondeps.toml +1 -1
index 98e99e79005..daf5a18989a 100644
@@ -32,5 +32,5 @@ sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" }
 sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
 
 [testdeps]
-qemu.qmp = { accepted = ">=0.0.3", installed = "0.0.3" }
+qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
 pygdbmi = { accepted = ">=0.11.0.0", installed = "0.11.0.0" }
Signature · 1 line
2.51.0
Reviewed-by on v1 4/10
#11 lore raw

Re: [PATCH RFC 04/10] python/mkvenv: bump 'qemu.qmp' dependency for testdeps

Quoted 17 lines · John Snow

Firstly, there is a new v0.0.5 that should be used instead of v0.0.3.

Secondly, the use of a period in the key name does not behave as expected when installing and checking for dependencies, so use underscore instead - which does indeed resolve to the same package.

---
  pythondeps.toml | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
pythondeps.toml +0 -0
index 98e99e79005..daf5a18989a 100644

pythondeps.toml sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" } · line 36

Quoted 6 lines
pythondeps.toml +1 -1
@@ -32,5 +32,5 @@ sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" }
  sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
 
  [testdeps]
-qemu.qmp = { accepted = ">=0.0.3", installed = "0.0.3" }
+qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
  pygdbmi = { accepted = ">=0.11.0.0", installed = "0.11.0.0" }
author
#12 lore raw

RFC PATCH 5/10 python/mkvenv: rename 'testdeps' to 'functests'

In reply to John Snow

pygdmi is only needed for functional tests and not tests in general; to prepare for more universally required test dependencies, rename this dependency group "functests" instead.

---
 pythondeps.toml        | 2 +-
 tests/Makefile.include | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
pythondeps.toml +1 -1
index daf5a18989a..3d6907af799 100644
@@ -31,6 +31,6 @@ meson = { accepted = ">=1.9.0", installed = "1.9.0", canary = "meson" }
 sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" }
 sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
 
-[testdeps]
+[functests]
 qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
 pygdbmi = { accepted = ">=0.11.0.0", installed = "0.11.0.0" }
tests/Makefile.include +1 -1
index d4dfbf3716d..6f86eb283d3 100644
@@ -98,7 +98,7 @@ quiet-venv-pip = $(quiet-@)$(call quiet-command-run, \
 
 $(TESTS_VENV_TOKEN): $(SRC_PATH)/pythondeps.toml
 	$(call quiet-venv-pip,install -e "$(SRC_PATH)/python/")
-	$(MKVENV_ENSUREGROUP) $< testdeps
+	$(MKVENV_ENSUREGROUP) $< functests
 	$(call quiet-command, touch $@)
 
 check-venv: $(TESTS_VENV_TOKEN)
Signature · 1 line
2.51.0
Reviewed-by on v1 5/10
#13 lore raw

Re: [PATCH RFC 05/10] python/mkvenv: rename 'testdeps' to 'functests'

Quoted 27 lines · John Snow

pygdmi is only needed for functional tests and not tests in general; to prepare for more universally required test dependencies, rename this dependency group "functests" instead.

---
  pythondeps.toml        | 2 +-
  tests/Makefile.include | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
pythondeps.toml +1 -1
index daf5a18989a..3d6907af799 100644
@@ -31,6 +31,6 @@ meson = { accepted = ">=1.9.0", installed = "1.9.0", canary = "meson" }
  sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" }
  sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
 
-[testdeps]
+[functests]
  qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
  pygdbmi = { accepted = ">=0.11.0.0", installed = "0.11.0.0" }
tests/Makefile.include +0 -0
index d4dfbf3716d..6f86eb283d3 100644

tests/Makefile.include quiet-venv-pip = $(quiet-@)$(call quiet-command-run, \ · line 104

Quoted 8 lines
tests/Makefile.include +1 -1
@@ -98,7 +98,7 @@ quiet-venv-pip = $(quiet-@)$(call quiet-command-run, \
 
  $(TESTS_VENV_TOKEN): $(SRC_PATH)/pythondeps.toml
  	$(call quiet-venv-pip,install -e "$(SRC_PATH)/python/")
-	$(MKVENV_ENSUREGROUP) $< testdeps
+	$(MKVENV_ENSUREGROUP) $< functests
  	$(call quiet-command, touch $@)
 
  check-venv: $(TESTS_VENV_TOKEN)
#14 lore raw

Re: [PATCH RFC 05/10] python/mkvenv: rename 'testdeps' to 'functests'

In reply to John Snow
Quoted 3 lines · John Snow

pygdmi is only needed for functional tests and not tests in general; to prepare for more universally required test dependencies, rename this dependency group "functests" instead.

By the way, "check-venv" also seems to be still in use by tests/vm/Makefile.include ... not sure whether you want to mention it here somewhere, though.

Thomas

author
#15 lore raw

RFC PATCH 6/10 python/mkvenv: add "tests" dependency group

In reply to John Snow

This group is intended for packages required to run "make check" successfully. Once qemu.qmp is fully divorced from the source tree, this will primarily mean the qemu.qmp package. It specifically excludes packages only needed to run the functional tests, which are not invoked by default for "make check".

---
 pythondeps.toml | 3 +++
 1 file changed, 3 insertions(+)
pythondeps.toml +3 -0
index 3d6907af799..70e83320855 100644
@@ -31,6 +31,9 @@ meson = { accepted = ">=1.9.0", installed = "1.9.0", canary = "meson" }
 sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" }
 sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
 
+[tests]
+qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
+
 [functests]
 qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
 pygdbmi = { accepted = ">=0.11.0.0", installed = "0.11.0.0" }
Signature · 1 line
2.51.0
#16 lore raw

Re: [PATCH RFC 06/10] python/mkvenv: add "tests" dependency group

Quoted 16 lines · John Snow

This group is intended for packages required to run "make check" successfully. Once qemu.qmp is fully divorced from the source tree, this will primarily mean the qemu.qmp package. It specifically excludes packages only needed to run the functional tests, which are not invoked by default for "make check".

---
  pythondeps.toml | 3 +++
  1 file changed, 3 insertions(+)
pythondeps.toml +0 -0
index 3d6907af799..70e83320855 100644

pythondeps.toml meson = { accepted = ">=1.9.0", installed = "1.9.0", canary = "meson" } · line 39

Quoted 9 lines
pythondeps.toml +3 -0
@@ -31,6 +31,9 @@ meson = { accepted = ">=1.9.0", installed = "1.9.0", canary = "meson" }
  sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" }
  sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
 
+[tests]
+qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
+
  [functests]
  qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
  pygdbmi = { accepted = ">=0.11.0.0", installed = "0.11.0.0" }

Hmm, "tests" is a string that is very hard to grep for, since it's used all over the place. Could we maybe continue to call this section "testdeps" or something else that is more unique?

Also, could the qemu_qmp be removed from the [functests] section now? As long as the python/qemu/qmp folder has not been removed yet, it should not be necessary - and as soon as it has been removed, the generic venv from "[tests]" should be in place, shouldn't it?

So maybe you could merge this patch with the previous one, simplifying the change here to something like this:

pythondeps.toml +2 -0
@@ -33,4 +33,6 @@ sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
 
 [testdeps]
 qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
+
+[functests]
 pygdbmi = { accepted = ">=0.11.0.0", installed = "0.11.0.0" }

?

Thomas

author
#17 lore raw

Re: [PATCH RFC 06/10] python/mkvenv: add "tests" dependency group

Quoted 21 lines · Thomas Huth
Quoted 19 lines · John Snow

This group is intended for packages required to run "make check" successfully. Once qemu.qmp is fully divorced from the source tree, this will primarily mean the qemu.qmp package. It specifically excludes packages only needed to run the functional tests, which are not invoked by default for "make check".

---
  pythondeps.toml | 3 +++
  1 file changed, 3 insertions(+)
pythondeps.toml +0 -0
index 3d6907af799..70e83320855 100644
@@ -31,6 +31,9 @@ meson = { accepted = ">=1.9.0", installed = "1.9.0", canary = "meson" }
  sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" }
  sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
 
Quoted 10 lines

pythondeps.toml meson = { accepted = ">=1.9.0", installed = "1.9.0", canary = "meson" } · line 39

Quoted 6 lines
pythondeps.toml +3 -0
+[tests]
+qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
+
  [functests]
  qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
  pygdbmi = { accepted = ">=0.11.0.0", installed = "0.11.0.0" }

Hmm, "tests" is a string that is very hard to grep for, since it's used all over the place. Could we maybe continue to call this section "testdeps" or something else that is more unique?

Sure, you got it. I think I did name it that at one point and then said "Well, these are all deps, that's kind of redundant", but greppability is a reasonable thing.

checktests?

Quoted 5 lines

Also, could the qemu_qmp be removed from the [functests] section now? As long as the python/qemu/qmp folder has not been removed yet, it should not be necessary - and as soon as it has been removed, the generic venv from "[tests]" should be in place, shouldn't it?

Sure, that's one way.

Pattern #1: each dependency group should contain everything it needs to run the tests/functionality associated with that dependency group Pattern #2: each dependency group should specify only the unique packages associated with that functionality

#1: dep groups are self-contained and easy to invoke, but dep groups could theoretically drift with conflicting package versions. #2: package deps are factored out and can't conflict, but those modifying the build system may need to remember that they need multiple dependency groups for certain classes of test.

I went with #1; if we go to #2, it just means that functests need to have a dependency on both tests/functests groups. That's fine too. Which is better? I don't really actually have enough insight to have a preference on this one. RFC?

On the subject of "make check-venv": I wasn't able to figure out how to really specify the deps for functests yet, I am still kind of hammering away at it like a child with a squeaky toy hammer... "make check" will invoke (some) iotests; the deps I added to meson in this series will adequately detect and cover this when you run this high-level target. However, "make check" will also run some of the func+quick tests, and I *didn't* specify the dependency there, and if you run make check with -j#, those tests can actually fail. (Well, once the in-tree library is removed, that is.)

Ideally I want to get rid of "make check-venv" entirely and use only meson targets that add dependency groups on demand, so I need to figure out the right places to inject these dependencies in the build system, and I've been having trouble figuring that out.

Quoted 15 lines

So maybe you could merge this patch with the previous one, simplifying the change here to something like this:

pythondeps.toml +2 -0
@@ -33,4 +33,6 @@ sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
 
  [testdeps]
  qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
+
+[functests]
  pygdbmi = { accepted = ">=0.11.0.0", installed = "0.11.0.0" }
Quoted 1 line

?

If after my waffling above you still think that's the right way to go, I'm happy to do it. I just need to figure out how to axe the check-venv target, too, I think.

Quoted 3 lines

Thomas

#18 lore raw

Re: [PATCH RFC 06/10] python/mkvenv: add "tests" dependency group

Quoted 33 lines · John Snow
Quoted 21 lines · Thomas Huth
Quoted 19 lines · John Snow

This group is intended for packages required to run "make check" successfully. Once qemu.qmp is fully divorced from the source tree, this will primarily mean the qemu.qmp package. It specifically excludes packages only needed to run the functional tests, which are not invoked by default for "make check".

---
   pythondeps.toml | 3 +++
   1 file changed, 3 insertions(+)
pythondeps.toml +0 -0
index 3d6907af799..70e83320855 100644
@@ -31,6 +31,9 @@ meson = { accepted = ">=1.9.0", installed = "1.9.0", canary = "meson" }
   sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" }
   sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
 
Quoted 10 lines

pythondeps.toml meson = { accepted = ">=1.9.0", installed = "1.9.0", canary = "meson" } · line 39

Quoted 6 lines
pythondeps.toml +3 -0
+[tests]
+qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
+
   [functests]
   qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
   pygdbmi = { accepted = ">=0.11.0.0", installed = "0.11.0.0" }

Hmm, "tests" is a string that is very hard to grep for, since it's used all over the place. Could we maybe continue to call this section "testdeps" or something else that is more unique?

Quoted 5 lines

Sure, you got it. I think I did name it that at one point and then said "Well, these are all deps, that's kind of redundant", but greppability is a reasonable thing.

checktests?

Fine for me!

Quoted 18 lines
Quoted 4 lines

Also, could the qemu_qmp be removed from the [functests] section now? As long as the python/qemu/qmp folder has not been removed yet, it should not be necessary - and as soon as it has been removed, the generic venv from "[tests]" should be in place, shouldn't it?

Sure, that's one way.

Pattern #1: each dependency group should contain everything it needs to run the tests/functionality associated with that dependency group Pattern #2: each dependency group should specify only the unique packages associated with that functionality

#1: dep groups are self-contained and easy to invoke, but dep groups could theoretically drift with conflicting package versions. #2: package deps are factored out and can't conflict, but those modifying the build system may need to remember that they need multiple dependency groups for certain classes of test.

Quoted 4 lines

I went with #1; if we go to #2, it just means that functests need to have a dependency on both tests/functests groups. That's fine too. Which is better? I don't really actually have enough insight to have a preference on this one. RFC?

Are we going to have different venv folders for each category? If so, #1 is likely the best approach. Otherwise I'd maybe rather go with #2 to avoid that we accidentally specify different qemu.qmp versions for the different categories.

Quoted 7 lines

On the subject of "make check-venv": I wasn't able to figure out how to really specify the deps for functests yet, I am still kind of hammering away at it like a child with a squeaky toy hammer... "make check" will invoke (some) iotests; the deps I added to meson in this series will adequately detect and cover this when you run this high-level target. However, "make check" will also run some of the func+quick tests, and I *didn't* specify the dependency there,

Apart from pycotap and qemu.qmp, the func+quick tests should not have any further dependencies. Everything that needs additional dependencies should go into the thorough category.

Quoted 3 lines

and if
you run make check with -j#, those tests can actually fail. (Well, once the in-tree library is removed, that is.)

Oh, why that?

Quoted 4 lines

Ideally I want to get rid of "make check-venv" entirely and use only meson targets that add dependency groups on demand, so I need to figure out the right places to inject these dependencies in the build system, and I've been having trouble figuring that out.

Sorry, I'm also still quite a meson ignorant so far ... maybe Paolo or Marc-André could help?

Thomas

author
#19 lore raw

RFC PATCH 7/10 meson: create meson custom target for python test dependencies

In reply to John Snow

RFC: I can't actually seem to make this depend on the group file as it is stored in the pyvenv directory, so the output for this target doesn't actually exist. Not ideal, but I want to send an RFC to the list before spending too much time figuring this out.

---
 tests/meson.build | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
tests/meson.build +15 -0
index cbe79162411..e61efc21802 100644
@@ -1,3 +1,18 @@
+pyvenv_test_deps = custom_target(
+    'pyvenv_test_deps',
+    output: 'tests.group',
+    input: files(
+        meson.source_root() + '/pythondeps.toml',
+        meson.source_root() + '/python/scripts/mkvenv.py'
+    ),
+
+    command: [ python, '@INPUT1@',
+               'ensuregroup',
+               '--dir', meson.source_root() + '/python/wheels',
+               '@INPUT0@',
+               'tests' ],
+)
+
 subdir('bench')
 subdir('qemu-iotests')
 
Signature · 1 line
2.51.0
author
#20 lore raw

RFC PATCH 8/10 meson: make iotests depend on pyvent_test_deps

In reply to John Snow
---
 tests/qemu-iotests/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/meson.build +1 -1
index fad340ad595..e4c9f27ecad 100644
@@ -62,7 +62,7 @@ foreach format, speed: qemu_iotests_formats
       test('io-' + format + '-' + item,
            python,
            args: args,
-           depends: qemu_iotests_binaries,
+           depends: qemu_iotests_binaries + pyvenv_test_deps,
            env: qemu_iotests_env,
            protocol: 'tap',
            timeout: 180,
Signature · 1 line
2.51.0
author
#21 lore raw

RFC PATCH 9/10 python: quote dotted dependency keys

In reply to John Snow
---
 pythondeps.toml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
pythondeps.toml +2 -2
index 70e83320855..a5cdf94a791 100644
@@ -32,8 +32,8 @@ sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" }
 sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
 
 [tests]
-qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
+"qemu.qmp" = { accepted = ">=0.0.5", installed = "0.0.5" }
 
 [functests]
-qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
+"qemu.qmp" = { accepted = ">=0.0.5", installed = "0.0.5" }
 pygdbmi = { accepted = ">=0.11.0.0", installed = "0.11.0.0" }
Signature · 1 line
2.51.0
#22 lore raw

Re: [PATCH RFC 09/10] python: quote dotted dependency keys

Quoted 10 lines · John Snow
---
  pythondeps.toml | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
pythondeps.toml +0 -0
index 70e83320855..a5cdf94a791 100644

pythondeps.toml sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" } · line 39

Quoted 10 lines
pythondeps.toml +2 -2
@@ -32,8 +32,8 @@ sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" }
  sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
 
  [tests]
-qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
+"qemu.qmp" = { accepted = ">=0.0.5", installed = "0.0.5" }
 
  [functests]
-qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
+"qemu.qmp" = { accepted = ">=0.0.5", installed = "0.0.5" }
  pygdbmi = { accepted = ">=0.11.0.0", installed = "0.11.0.0" }

Uh, why not immediately using this in patch 4 ?

Thomas

author
#23 lore raw

Re: [PATCH RFC 09/10] python: quote dotted dependency keys

Quoted 18 lines · Thomas Huth

pythondeps.toml sphinx = { accepted = ">=3.4.3", installed = "6.2.1",

Quoted 10 lines · John Snow
---
  pythondeps.toml | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
pythondeps.toml +0 -0
index 70e83320855..a5cdf94a791 100644
@@ -32,8 +32,8 @@ sphinx = { accepted = ">=3.4.3", installed = "6.2.1",

canary = "sphinx-build" }

Quoted 6 lines
pythondeps.toml +1 -1
  sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
 
  [tests]
-qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
+"qemu.qmp" = { accepted = ">=0.0.5", installed = "0.0.5" }
 
Quoted 7 lines

pythondeps.toml sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" } · line 39

Quoted 4 lines
pythondeps.toml +1 -1
  [functests]
-qemu_qmp = { accepted = ">=0.0.5", installed = "0.0.5" }
+"qemu.qmp" = { accepted = ">=0.0.5", installed = "0.0.5" }
  pygdbmi = { accepted = ">=0.11.0.0", installed = "0.11.0.0" }

Uh, why not immediately using this in patch 4 ?

Mea culpa, I fixed this after send. I really meant "RFC" this time, sorry!

Quoted 3 lines

Thomas

author
#24 lore raw

RFC PATCH 10/10 python: delete qemu.qmp

In reply to John Snow

Begin relying on the external python-qemu-qmp dependency instead, to prevent desync between the internal and external libraries.

---
 .gitlab-ci.d/buildtest.yml                    |    1 +
 python/qemu/qmp/__init__.py                   |   60 -
 python/qemu/qmp/error.py                      |   53 -
 python/qemu/qmp/events.py                     |  751 -----------
 python/qemu/qmp/legacy.py                     |  339 -----
 python/qemu/qmp/message.py                    |  217 ----
 python/qemu/qmp/models.py                     |  146 ---
 python/qemu/qmp/protocol.py                   | 1101 -----------------
 python/qemu/qmp/py.typed                      |    0
 python/qemu/qmp/qmp_client.py                 |  732 -----------
 python/qemu/qmp/qmp_shell.py                  |  689 -----------
 python/qemu/qmp/qmp_tui.py                    |  665 ----------
 python/qemu/qmp/util.py                       |  150 ---
 python/qemu/utils/qom_fuse.py                 |    1 -
 python/scripts/vendor.py                      |    2 +
 python/setup.cfg                              |   31 +-
 python/tests/minreqs.txt                      |    8 +-
 python/tests/protocol.py                      |  596 ---------
 python/wheels/qemu_qmp-0.0.5-py3-none-any.whl |  Bin 0 -> 72263 bytes
 19 files changed, 9 insertions(+), 5533 deletions(-)
 delete mode 100644 python/qemu/qmp/__init__.py
 delete mode 100644 python/qemu/qmp/error.py
 delete mode 100644 python/qemu/qmp/events.py
 delete mode 100644 python/qemu/qmp/legacy.py
 delete mode 100644 python/qemu/qmp/message.py
 delete mode 100644 python/qemu/qmp/models.py
 delete mode 100644 python/qemu/qmp/protocol.py
 delete mode 100644 python/qemu/qmp/py.typed
 delete mode 100644 python/qemu/qmp/qmp_client.py
 delete mode 100644 python/qemu/qmp/qmp_shell.py
 delete mode 100644 python/qemu/qmp/qmp_tui.py
 delete mode 100644 python/qemu/qmp/util.py
 delete mode 100644 python/tests/protocol.py
 create mode 100644 python/wheels/qemu_qmp-0.0.5-py3-none-any.whl
.gitlab-ci.d/buildtest.yml +1 -0
index 21f6d7e96fe..a2b509a0aef 100644
@@ -350,6 +350,7 @@ build-tcg-disabled:
     - make -j"$JOBS"
     - make check-unit
     - make check-qapi-schema
+    - meson compile "tests/pyvenv_test_deps"
     - cd tests/qemu-iotests/
     - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
             052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
python/qemu/qmp/__init__.py deleted +0 -60

60 lines not on this page · raw message

python/qemu/qmp/error.py deleted +0 -53

53 lines not on this page · raw message

python/qemu/qmp/events.py deleted +0 -751

751 lines not on this page · raw message

python/qemu/qmp/legacy.py deleted +0 -339

339 lines not on this page · raw message

python/qemu/qmp/message.py deleted +0 -217

217 lines not on this page · raw message

python/qemu/qmp/models.py deleted +0 -146

146 lines not on this page · raw message

python/qemu/qmp/protocol.py deleted +0 -1101

1,101 lines not on this page · raw message

python/qemu/qmp/py.typed deleted +0 -0
deleted file mode 100644
index e69de29bb2d..00000000000
python/qemu/qmp/qmp_client.py deleted +0 -732

326 lines not on this page · raw message

python/qemu/qmp/qmp_shell.py deleted +0 -689

689 lines not on this page · raw message

python/qemu/qmp/qmp_tui.py deleted +0 -665

665 lines not on this page · raw message

python/qemu/qmp/util.py deleted +0 -150

150 lines not on this page · raw message

python/qemu/utils/qom_fuse.py +0 -1
index cf7e344bd53..e377ef6942f 100644

Lines of this file are not shown. View the raw message.

python/scripts/vendor.py +2 -0
index 33ac7a45de0..36cd27046e7 100755

Lines of this file are not shown. View the raw message.

python/setup.cfg +3 -28
index f40f11396c9..c46a95f8d41 100644

Lines of this file are not shown. View the raw message.

python/tests/minreqs.txt +3 -5
index cd2e2a81c3d..855b5129c94 100644

Lines of this file are not shown. View the raw message.

python/tests/protocol.py deleted +0 -596

596 lines not on this page · raw message

python/wheels/qemu_qmp-0.0.5-py3-none-any.whl new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..6372b7544ffb015a5c77d9686e921b65c848d433
GIT binary patch

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.51.0

Part of the diff is not shown here. View the raw message.