summaryrefslogtreecommitdiff
path: root/python
AgeCommit message (Collapse)Author
11 daystests: switch from -mon to -object monitor-qmpDaniel P. Berrangé
Use the new preferred low level option for configuring the QMP service in libqtest and the python Machine class used by tests. This will avoid triggering deprecation warnings after the subsequent commit. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Tested-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20260706135824.2623960-34-berrange@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2026-06-23python/qemu: dump a developer friendly version of cmdline to logsAlex Bennée
Now we have the arguments nicely split up we can make _console_args a function call and present a slightly different version to the logs to save developers manually hacking the command line up. Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260619155657.944220-4-alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-06-22python/qemu: split console from harness argsAlex Bennée
Before we mess with the console output lets create a new helper just for that. Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260619155657.944220-3-alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-06-22python/qemu: split arg between base and harness listsAlex Bennée
There are argument we add because we want the test harness to control QEMU and arguments we default for handling the display and machine type. Split the obvious ones between base_args and a new list called harness_args. We will leave the complexity of the serial ports for now. Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260619155657.944220-2-alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-06-15python: temporarily restrict max mypy versionJohn Snow
The newest versions of mypy do not support targeting Python 3.9, which we still support. I want to address that soon, but in the meantime it's nice if the tests pass. Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20260611042332.482979-2-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2026-05-21python: bump qemu.qmp to v0.0.6John Snow
This release removes some deprecated warnings for our use of the old sendmsg API on older python versions. Acked-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2026-04-30minikconf: add mypy annotationsPaolo Bonzini
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-04-30minikconf: run through isortPaolo Bonzini
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-04-30pythondeps: bump to meson 1.11.1Pierrick Bouvier
Prior to 1.11.0, build with rust didn't use link_args. In QEMU case, it means that plugins could not work, since they rely on link_args to expose symbols from QEMU binary. https://mesonbuild.com/Release-notes-for-1-11-0.html#change-to-handling-of-linker-arguments-for-rust With this change, QEMU built with --enable-rust can pass all CI tests, including tests related to plugins. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> [Move from 1.11.0 to 1.11.1. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-03-09python: add formal python3.14 support and testingJohn Snow
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260226213400.1254014-5-jsnow@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com>
2026-03-09python: drop avocadoJohn Snow
Avocado-framework is no longer used for anything, so it can be removed. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260226213400.1254014-4-jsnow@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com>
2026-03-09python: replace avocado tests with pytestJohn Snow
Following suit with the rest of this repository, drop avocado and replace it with the Python standard "pytest" package. Our ultimate goal is to merge these python tests with the meson test suite, so the use of 'pytest' here is only a stop-gap solution to get the GitLab CI 'check-python-tox' passing again following recent Python packaging ecosystem changes. Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20260226213400.1254014-3-jsnow@redhat.com> [ran black autoformatter. --js] Signed-off-by: John Snow <jsnow@redhat.com>
2026-03-09python: pin 'wheel' version in minreqs testJohn Snow
With recent python packaging ecosystem updates, the latest 'wheel' is no longer compatible with older packages - and was somehow still compatible with our Python 3.9 environment. Pin wheel to an older version (Version based on Debian 11's available wheel package) to remove warnings during the minreqs test. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20260226213400.1254014-2-jsnow@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com>
2026-02-27scripts/vendor.py: add pycotapMarc-André Lureau
Related to commit 5ec1eec11000ef118b2a87c330245ffaa475f5ee ("python: Install pycotap in our venv if necessary") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Link: https://lore.kernel.org/r/20260211-cleanups-v1-3-e63c96572389@redhat.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-02-27python/wheel: remove meson-1.9.0Marc-André Lureau
Leftover from commit 8c04b6a48b15a478ff3f9d152592a0ba503a31e4. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Link: https://lore.kernel.org/r/20260211-cleanups-v1-2-e63c96572389@redhat.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-02-24python: update README.rst to reflect qemu.qmp's removalJohn Snow
It is no longer simply possible to just use this directory as if it were an installed package now that it has dependencies, so update the README to reflect this. Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20260218213416.674483-20-jsnow@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com>
2026-02-24python: delete qemu.qmpJohn Snow
Start relying on the external python-qemu-qmp dependency instead, to prevent desync between the internal and external libraries. This library is now entirely independent; to contribute changes, see https://gitlab.com/qemu-project/python-qemu-qmp/ Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260218213416.674483-19-jsnow@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com>
2026-02-24python: add vendored qemu.qmp packageJohn Snow
In anticipation of deleting the python/qemu/qmp source from the tree, add a vendored version of the qemu.qmp package to ensure that "make check" can be run in isolated build environments, offline. Acked-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260218213416.674483-13-jsnow@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com>
2026-02-23python/mkvenv: add mechanism to install local package(s)John Snow
Currently, we "implicitly" install the local 'qemu' python package for 'make check-venv' with some logic inside tests/Makefile.include. I would like to make this installation explicit in pythondeps.toml instead. This patch adds a path constraint that can be used in lieu of version constraints to specify that a package should be installed from the source tree instead of from PyPI or vendored packages. This is done to allow us to install the python packages hosted inside of the tree while also processing dependencies; i.e. so that our "qemu" package can specify that it needs "qemu.qmp", which soon will not be included in qemu.git. This also has the benefit of being able to specify in a declarative configuration file that our pyvenv environment *will* have our local python packages installed and available without any PYTHONPATH hacks, which should simplify iotests, device-crash-test and functional tests without needing to manage local inclusion paths in environment variables. On the downsides, installing packages through mkvenv/ensuregroup means that there are extra steps we need to take in order to install a local package *offline*; namely we must disable build isolation (so we have access to setuptools) and we must also include python3-wheel in QEMU's build dependencies in order for "make check" to run successfully when in an offline, isolated environment. These extra dependencies are handled in a forthcoming commit; for now, nothing is utilizing this new pathway. Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260218213416.674483-6-jsnow@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com>
2026-02-23python/mkvenv: create timestamp file for each group "ensured"John Snow
Each group ensured by the mkvenv script will create an empty timestamp file named {groupname}.group which can be used to conditionally trigger dependency installation from various scripts and build machinery. Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260218213416.674483-3-jsnow@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com>
2026-02-12python: drop uses of pkg_resourcesJohn Snow
pkg_resources has been fully dropped from modern pip/setuptools distributions and we should phase out its use. This patch is enough to, by itself, repair most GitLab CI tests upstream; with the exception of tox tests which are still making use of avocado - which will be dropped in a separate series to restore functionality there. Signed-off-by: John Snow <jsnow@redhat.com> Suggested-by: Peter Maydell <peter.maydell@linaro.org> Message-ID: <20260211195804.135144-3-jsnow@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2026-02-02python: fix msys64 wheel directory specificationJohn Snow
In python3.14, fixes were made to the file URI parsing [1] such that file URIs that used to work but were technically out of spec are now broken. As a result, our msys2 GitLab CI tests began failing. Stop using "file://" URI links in favor of simple paths (Thanks pbo) to fix parsing errors under Python 3.14 and fix the msys2 GitLab CI tests. [1] https://docs.python.org/3/whatsnew/3.14.html#urllib Reported-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Suggested-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Tested-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20260130050518.517688-2-jsnow@redhat.com>
2025-12-27bump meson wheel to 1.10.0Paolo Bonzini
This version includes several improvements and bugfixes for Rust. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-19python/mkvenv: ensure HAVE_LIB variables are actually constantsJohn 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. Add a temporary variable with an underscore and assign to the global constants precisely once to alleviate this new nag message. Add an ignore for this name for older versions of pylint that developers may have installed locally. (In other words: there is no solution that will cater to both pre- and post- 4.x versions, so we target 4.x here and silence older versions.) Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20251118200657.1043688-2-jsnow@redhat.com>
2025-10-16python/qemu: Replace some remaining "avocados" with "functional tests"Thomas Huth
The avocado tests have been replaced by the new functional tests, so also update this in the README.rst files in the python directory accordingly. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20251008131936.71160-1-thuth@redhat.com>
2025-09-17configure: bump Meson to 1.9.0 for use with RustPaolo Bonzini
Meson 1.9.0 provides mixed linking of Rust and C objects. As a side effect, this also allows adding dependencies with "sources: ..." files to Rust crates that use structured_sources(). It can also clean up up the meson.build files for Rust noticeably, but due to an issue with doctests (see https://github.com/mesonbuild/meson/pull/14973) that will have to wait for 1.9.1. Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20250908105005.2119297-3-pbonzini@redhat.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-09-15python: ensure QEMUQtestProtocol closes its socketDaniel P. Berrangé
While QEMUQtestMachine closes the socket that was passed to QEMUQtestProtocol, the python resource leak manager still believes that the copy QEMUQtestProtocol holds is open. We must explicitly call close to avoid this leak warnnig. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-15python: synchronize qemu.qmp documentationJohn Snow
This patch collects comments and documentation changes from many commits in the python-qemu-qmp repository; bringing the qemu.git copy in bit-identical alignment with the standalone library *except* for several copyright messages that reference the "LICENSE" file which is, for QEMU, named "COPYING" instead and are therefore left unchanged. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-15python: backport 'avoid creating additional event loops per thread'John Snow
This commit is two backports squashed into one to avoid regressions. python: *really* remove get_event_loop A prior commit, aa1ff990, switched away from using get_event_loop *by default*, but this is not good enough to avoid deprecation warnings as `asyncio.get_event_loop_policy().get_event_loop()` is *also* deprecated. Replace this mechanism with explicit calls to asyncio.get_new_loop() and revise the cleanup mechanisms in __del__ to match. python: avoid creating additional event loops per thread "Too hasty by far!", commit 21ce2ee4 attempted to avoid deprecated behavior altogether by calling new_event_loop() directly if there was no loop currently running, but this has the unfortunate side effect of potentially creating multiple event loops per thread if tests instantiate multiple QMP connections in a single thread. This behavior is apparently not well-defined and causes problems in some, but not all, combinations of Python interpreter version and platform environment. Partially revert to Daniel Berrange's original patch, which calls get_event_loop and simply suppresses the deprecation warning in Python<=3.13. This time, however, additionally register new loops created with new_event_loop() so that future calls to get_event_loop() will return the loop already created. Reported-by: Richard W.M. Jones <rjones@redhat.com> Reported-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> cherry picked from commit python-qemu-qmp@21ce2ee4f2df87efe84a27b9c5112487f4670622 cherry picked from commit python-qemu-qmp@c08fb82b38212956ccffc03fc6d015c3979f42fe Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-15python: backport 'Remove deprecated get_event_loop calls'John Snow
This method was deprecated in 3.12 because it ordinarily should not be used from coroutines; if there is not a currently running event loop, this automatically creates a new event loop - which is usually not what you want from code that would ever run in the bottom half. In our case, we do want this behavior in two places: (1) The synchronous shim, for convenience: this allows fully sync programs to use QEMUMonitorProtocol() without needing to set up an event loop beforehand. This is intentional to fully box in the async complexities into the legacy sync shim. (2) The qmp_tui shell; instead of relying on asyncio.run to create and run an asyncio program, we need to be able to pass the current asyncio loop to urwid setup functions. For convenience, again, we create one if one is not present to simplify the creation of the TUI appliance. The remaining user of get_event_loop() was in fact one of the erroneous users that should not have been using this function: if there's no running event loop inside of a coroutine, you're in big trouble :) Signed-off-by: John Snow <jsnow@redhat.com> cherry picked from commit python-qemu-qmp@aa1ff9907603a3033296027e1bd021133df86ef1 Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-15python: backport 'qmp-tui: Do not crash if optional dependencies are not met'John Snow
Based on the discussion at https://github.com/pypa/pip/issues/9726 - even though the setuptools documentation implies that it is possible to guard script execution with optional dependency groups, this is not true in practice with the scripts generated by pip. Just do the simple thing and guard the import statements. Signed-off-by: John Snow <jsnow@redhat.com> cherry picked from commit python-qemu-qmp@df520dcacf9a75dd4c82ab1129768de4128b554c Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-15python: backport 'qmp-shell-wrap: handle missing binary gracefully'John Snow
Signed-off-by: John Snow <jsnow@redhat.com> cherry picked from commit python-qemu-qmp@9c889dcbd58817b0c917a9d2dd16161f48ac8203 Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-15python: backport 'make require() preserve async-ness'John Snow
This is not strictly needed functionality-wise, but doing this allows sphinx to see which decorated methods are async. Without this, sphinx misses the "async" classifier on generated docs, which ... for an async library, isn't great. It does make an already gnarly function even gnarlier, though. So, what's going on here? A synchronous function (like require() before this patch) can return a coroutine that can be awaited on, for example: def some_func(): return asyncio.task(asyncio.sleep(5)) async def some_async_func(): await some_func() However, this function is not considered to be an "async" function in the eyes of the abstract syntax tree. Specifically, some_func.__code__.co_flags will not be set with CO_COROUTINE. The interpreter uses this flag to know if it's legal to use "await" from within the body of the function. Since this function is just wrapping another function, it doesn't matter much for the decorator, but sphinx uses the stdlib inspect.iscoroutinefunction() to determine when to add the "async" prefix in generated output. This function uses the presence of CO_COROUTINE. So, in order to preserve the "async" flag for docs, the require() decorator needs to differentiate based on whether it is decorating a sync or async function and use a different wrapping mechanism accordingly. Phew. Signed-off-by: John Snow <jsnow@redhat.com> cherry picked from commit python-qemu-qmp@40aa9699d619849f528032aa456dd061a4afa957 Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-15python: backport 'feat: allow setting read buffer limit'Adam Dorsey
Expose the limit parameter of the underlying StreamReader and StreamWriter instances. This is helpful for the use case of transferring files in and out of a VM via the QEMU guest agent's guest-file-open, guest-file-read, guest-file-write, and guest-file-close methods, as it allows pushing the buffer size up to the guest agent's limit of 48MB per transfer. Signed-off-by: Adam Dorsey <adam@dorseys.email> cherry picked from commit python-qemu-qmp@9ba6a698344eb3b570fa4864e906c54042824cd6 cherry picked from commit python-qemu-qmp@e4d0d3f835d82283ee0e48438d1b154e18303491 [Squashed in linter fixups. --js] Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-15python: backport 'qmp-shell: add common_parser()'John Snow
Signed-off-by: John Snow <jsnow@redhat.com> cherry picked from commit python-qemu-qmp@20a88c2471f37d10520b2409046d59e1d0f1e905 Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-15python: backport 'Use @asynciocontextmanager'John Snow
This removes a non-idiomatic use of a "coroutine callback" in favor of something a bit more standardized. Signed-off-by: John Snow <jsnow@redhat.com> cherry picked from commit python-qemu-qmp@commit 97f7ffa3be17a50544b52767d14b6fd478c07b9e Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-15python: backport 'drop Python3.6 workarounds'John Snow
Now that the minimum version is 3.7, drop some of the 3.6-specific hacks we've been carrying. A single remaining compatibility hack concerning 3.6's lack of @asynccontextmanager is addressed in the following commit. Signed-off-by: John Snow <jsnow@redhat.com> cherry picked from commit python-qemu-qmp@3e8e34e594cfc6b707e6f67959166acde4b421b8 Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-15python: backport 'protocol: adjust logging name when changing client name'John Snow
The client name is mutable, so the logging name should also change to reflect it when it changes. Signed-off-by: John Snow <jsnow@redhat.com> cherry picked from commit python-qemu-qmp@e10b73c633ce138ba30bc8beccd2ab31989eaf3d Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-15python: backport 'kick event queue on legacy event_pull()'John Snow
This corrects an oversight in qmp-shell operation where new events will not accumulate in the event queue when pressing "enter" with an empty command buffer, so no new events show up. Reported-by: Jag Raman <jag.raman@oracle.com> Signed-off-by: John Snow <jsnow@redhat.com> cherry picked from commit python-qemu-qmp@0443582d16cf9efd52b2c41a7b5be7af42c856cd Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-15python: backport 'EventListener: add __repr__ method'John Snow
When the object is not stateful, this repr method prints what you'd expect. In cases where there are pending events, the output is augmented to illustrate that. The object itself has no idea if it's "active" or not, so it cannot convey that information. Signed-off-by: John Snow <jsnow@redhat.com> cherry picked from commit python-qemu-qmp@8a6f2e136dae395fec8aa5fd77487cfe12d9e05e Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-15python: backport 'Change error classes to have better repr methods'John Snow
By passing all of the arguments to the base class and overriding the __str__ method when we want a different "human readable" message that isn't just printing the list of arguments, we can ensure that all custom error classes have a reasonable __repr__ implementation. In the case of ExecuteError, the pseudo-field that isn't actually correlated to an input argument can be re-imagined as a read-only property; this forces consistency in the class and makes the repr output more obviously correct. Signed-off-by: John Snow <jsnow@redhat.com> cherry picked from commit python-qemu-qmp@afdb7893f3b34212da4259b7202973f9a8cb85b3 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-08-22python: mkvenv: fix messages printed by mkvenvPaolo Bonzini
The new Matcher class does not have a __str__ implementation, and therefore it prints the debugging representation of the internal object: $ ../configure --enable-rust && make qemu-system-arm --enable-download python determined to be '/usr/bin/python3' python version: Python 3.13.6 mkvenv: Creating non-isolated virtual environment at 'pyvenv' mkvenv: checking for LegacyMatcher('meson>=1.5.0') mkvenv: checking for LegacyMatcher('pycotap>=1.1.0') Add the method to print the nicer mkvenv: checking for meson>=1.5.0 mkvenv: checking for pycotap>=1.1.0 Cc: qemu-stable@nongnu.org Cc: John Snow <jsnow@redhat.com> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-12mkvenv: Support pip 25.2Sv. Lockal
Fix compilation with pip-25.2 due to missing distlib.version Bug: https://gitlab.com/qemu-project/qemu/-/issues/3062 Signed-off-by: Sv. Lockal <lockalsash@gmail.com> [Edits: Type "safety" whackamole --js] Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250811190159.237321-1-jsnow@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-07-16python: fix editable installs for modern pip/setuptoolsJohn Snow
The way editable installs work has changed at some point since Fedora 40 was released. Generally, we should be opting to use pyproject.toml installs (PEP517/518) - but those are not fully supported until v61 of setuptools, and CentOS Stream 9 ships v53. Until that time, we can make use of a transitional feature in pip/setuptools to use "legacy" editable installs, which is enough to fix "make check-dev" on modern local workstations for now. By using the environment variable approach to configure pip, we avoid any problems for older versions of pip that don't recognize this option, so it's harmless. The config-settings option first appeared in v23 of pip. editable_mode was first supported by setuptools in v64. (I'm not currently precisely aware of when the default behavior of '-e' switched away from 'compat', but it appears to be a joint effect between setuptools and pip versions.) Version information for supported build platforms: distro python3 pip setuptools sphinx -------------------------------------------------------- centos_stream_9 3.9.23 21.3.1 53.0.0 3.4.3 ubuntu_22_04 3.10.12 22.0.2 59.6.0 4.3.2 ** pyproject.toml installs supported as of here ** freebsd 3.11.13 23.3.2 63.1.0 5.3.0 debian_12 3.11.2 23.0.1 66.1.1 5.3.0 ubuntu_24_04 3.12.3 24.0 68.1.2 7.2.6 centos_stream_10 3.12.11 23.3.2 69.0.3 7.2.6 fedora_41 3.13.5 24.2 69.2.0 7.3.7 alpine_3_19 3.11.13 23.3.1 70.3.0 6.2.1 alpine_3_20 3.12.11 24.0 70.3.0 7.2.6 alpine_3_21 3.12.11 24.3.1 70.3.0 8.1.3 ubuntu_24_10 3.12.7 24.2 74.1.2 7.4.7 fedora_42 3.13.5 24.3.1 74.1.3 8.1.3 ubuntu_25_04 3.13.3 25.0 75.8.0 8.1.3 macports 3.13.5 25.1.1 78.1.1 8.2.3 openbsd 3.12.11 25.1.1 79.0.1 8.2.3 alpine_3_22 3.12.11 25.1.1 80.9.0 8.2.3 homebrew 3.13.5 --- 80.9.0 8.2.3 pkgsrc_current 3.12.11 25.1.1 80.9.0 8.2.3 Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250715222548.198888-1-jsnow@redhat.com> Tested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2025-07-16python: use qom-list-getSteve Sistare
Use qom-list-get to speed up the qom-tree command. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Acked-by: Markus Armbruster <armbru@redhat.com> Message-ID: <1752248703-217318-3-git-send-email-steven.sistare@oracle.com> Tested-by: Markus Armbruster <armbru@redhat.com> [Lint picked off to mollify make check-minreqs] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2025-07-14docs/sphinx: remove legacy QAPI manual generatorJohn Snow
Thanks for your service! Remove the old qapidoc and the option to enable the transmogrifier, leaving the "transmogrifier" as the ONLY qapi doc generator. This in effect also converts the QAPI test to use the new documentation generator, too. Update doc-good.txt output to match the new doc generator, which I should've done exactly when we switched over to the transmogrifier, but, uhh, oops! Notes on the new format: 1. per-member IFCOND documentation is missing. Known issue. 2. Freeform documentation without a header is now copied through into the output. This is a bug fix. Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250618165353.1980365-4-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Fixes: b61a4eb3f32 (docs/qapidoc: support header-less freeform sections) [Tweak commit message to say it's a bug fix, add Fixes:] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2025-07-01tests/functional: Add hvf_available() helperPeter Maydell
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 20250623121845.7214-26-philmd@linaro.org [PMM: tweaks to satisfy the python linter CI job] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2025-06-05python: Drop redundant warn_unused_configs = TrueMarkus Armbruster
strict = True implies warn_unused_configs = True. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: 20250604200354.459501-6-jsnow@redhat.com
2025-06-05python: add qapi static analysis testsJohn Snow
Update the python tests to also check QAPI and the QAPI Sphinx extensions. The docs/sphinx/qapidoc_legacy.py file is not included in these checks, as it is destined for removal soon. mypy is also not called on the QAPI Sphinx extensions, owing to difficulties supporting Sphinx 3.x - 8.x while maintaining static type checking support. mypy *is* called on all of the QAPI tools themselves, though. flake8, isort and mypy use the tool configuration from the existing python directory (in setup.cfg). pylint continues to use the special configuration located in scripts/qapi/ - that configuration is more permissive. If we wish to unify the two configurations, that's a separate series and a discussion for a later date. The list of pylint ignores is also updated, owing again to the wide window of pylint version support: newer versions require pragmas to occasionally silence the "too many positional arguments" warning, but older versions do not have such a warning category and will instead yelp about an unrecognized option. Silence that warning, too. As a result of this patch, one would be able to run any of the following tests locally from the qemu.git/python directory and have it cover the QAPI tooling as well. All of the following options run the python tests, static analysis tests, and linter checks; but with different combinations of dependencies and interpreters. - "make check-minreqs" Run tests specifically under our oldest supported Python and our oldest supported dependencies. This is the test that runs on GitLab as "check-python-minreqs". This helps ensure we do not regress support on older platforms accidentally. - "make check-tox" Runs the tests under the newest supported dependencies, but under each supported version of Python in turn. At time of writing, this is Python 3.8 to 3.13 inclusive. This test helps catch bleeding-edge problems before they become problems for developer workstations. This is the GitLab test "check-python-tox" and is an optionally run, may-fail test due to the unpredictable nature of new dependencies being released into the ecosystem that may cause regressions. - "make check-dev" Runs the tests under the newest supported dependencies using whatever version of Python the user happens to have installed. This is a quick convenience check that does not map to any particular GitLab test. (Note! check-dev may be busted on Fedora 41 and bleeding edge versions of setuptools. That's unrelated to this patch and I'll address it separately and soon. Thank you for your patience, --mgmt) Finally, finally, finally: this means that QAPI tooling will be linted and type-checked from the GitLab pipelines. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: 20250604200354.459501-5-jsnow@redhat.com [Edited license choice per review --js] Signed-off-by: John Snow <jsnow@redhat.com>
2025-06-05python: update missing dependencies from minreqsJohn Snow
We pin all dependencies for the "check-minreqs" test because pip lacks a dependency resolver that installs "the oldest possible package that meets dependency criteria". So, in order to test our stated minimum requirements, we pin all of our dependencies (and their dependencies, transitively) at the oldest possible versions that still work and pass tests; proving that our minimum requirements are correct. (It also ensures no new features accidentally sneak in from developers on newer platforms.) A few transitive dependencies were omitted from the pinned dependency file by accident; as a result, pip's dependency solver can pull in newer dependencies, which we don't want. This patch corrects the previous oversight and pins the missing dependencies. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: 20250604200354.459501-4-jsnow@redhat.com