[PATCH v2 00/12] Python: Fix 'make check-dev' and modernize to 3.9+

John Snow posted 12 patches 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250612205451.1177751-1-jsnow@redhat.com
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, John Snow <jsnow@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>, Cleber Rosa <crosa@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Maksim Davydov <davydov-max@yandex-team.ru>, Richard Henderson <richard.henderson@linaro.org>, Ani Sinha <anisinha@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>, Alexander Bulekov <alxndr@bu.edu>, Bandan Das <bsd@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Fabiano Rosas <farosas@suse.de>, Darren Kenny <darren.kenny@oracle.com>, Qiuhao Li <Qiuhao.Li@outlook.com>, Ahmed Karaman <ahmedkhaledkaraman@gmail.com>, Alexandre Iooss <erdnaxe@crans.org>, Mahmoud Mandour <ma.mandourr@gmail.com>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, Mads Ynddal <mads@ynddal.dk>, Fam Zheng <fam@euphon.net>, Manos Pitsidianakis <manos.pitsidianakis@linaro.org>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, Peter Xu <peterx@redhat.com>, Brian Cain <brian.cain@oss.qualcomm.com>, Alessandro Di Federico <ale@rev.ng>, Anton Johansson <anjo@rev.ng>, "Cédric Le Goater" <clg@kaod.org>, Steven Lee <steven_lee@aspeedtech.com>, Troy Lee <leetroy@gmail.com>, Jamin Lin <jamin_lin@aspeedtech.com>, Andrew Jeffery <andrew@codeconstruct.com.au>, Joel Stanley <joel@jms.id.au>, Bernhard Beschow <shentey@gmail.com>, Radoslaw Biernacki <rad@semihalf.com>, Leif Lindholm <leif.lindholm@oss.qualcomm.com>, Eric Auger <eric.auger@redhat.com>, Alistair Francis <alistair@alistair23.me>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Laurent Vivier <laurent@vivier.eu>, Antony Pavlov <antonynpavlov@gmail.com>, Beniamino Galvani <b.galvani@gmail.com>, Strahinja Jankovic <strahinja.p.jankovic@gmail.com>, Subbaraya Sundeep <sundeep.lkml@gmail.com>, Niek Linnenbank <nieklinnenbank@gmail.com>, Tyrone Ting <kfting@nuvoton.com>, Hao Wu <wuhaotsh@google.com>, Igor Mitsyanko <i.mitsyanko@gmail.com>, Michael Rolnik <mrolnik@gmail.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Helge Deller <deller@gmx.de>, Jason Wang <jasowang@redhat.com>, Yi Liu <yi.l.liu@intel.com>, "Clément Mathieu--Drif" <clement.mathieu--drif@eviden.com>, Song Gao <gaosong@loongson.cn>, Aurelien Jarno <aurelien@aurel32.net>, Huacai Chen <chenhuacai@kernel.org>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Elena Ufimtseva <elena.ufimtseva@oracle.com>, Jagannathan Raman <jag.raman@oracle.com>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>, Jia Liu <proljc@gmail.com>, Nicholas Piggin <npiggin@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, "Frédéric Barrat" <fbarrat@linux.ibm.com>, "Hervé Poussineau" <hpoussin@reactos.org>, BALATON Zoltan <balaton@eik.bme.hu>, Palmer Dabbelt <palmer@dabbelt.com>, Weiwei Li <liwei1518@gmail.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Nina Schoetterl-Glausch <nsg@linux.ibm.com>, Magnus Damm <magnus.damm@gmail.com>, David Hildenbrand <david@redhat.com>, David Woodhouse <dwmw2@infradead.org>, Paul Durrant <paul@xen.org>, Max Filippov <jcmvbkbc@gmail.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Eric Blake <eblake@redhat.com>, Hyman Huang <yong.huang@smartx.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, Ed Maste <emaste@freebsd.org>, Li-Wen Hsu <lwhsu@freebsd.org>
docs/conf.py                                  |  13 +-
docs/sphinx/compat.py                         |  12 +-
docs/sphinx/dbusdoc.py                        |  28 +-
docs/sphinx/dbusdomain.py                     |  39 +--
docs/sphinx/dbusparser.py                     |   4 +-
docs/sphinx/depfile.py                        |  11 +-
docs/sphinx/fakedbusdoc.py                    |   5 +-
docs/sphinx/hxtool.py                         |   7 +-
docs/sphinx/kerneldoc.py                      |   8 +-
docs/sphinx/qapi_domain.py                    |  81 +++---
docs/sphinx/qapidoc.py                        |  29 +-
docs/sphinx/qapidoc_legacy.py                 |   1 -
docs/sphinx/qmp_lexer.py                      |   7 +-
python/README.rst                             |  33 ++-
.gitlab-ci.d/check-dco.py                     |   9 +-
.gitlab-ci.d/check-patch.py                   |   7 +-
.gitlab-ci.d/check-units.py                   |   8 +-
python/Makefile                               |  18 +-
python/pyproject.toml                         |  10 +
python/qemu/machine/console_socket.py         |   6 +-
python/qemu/machine/machine.py                |  34 +--
python/qemu/machine/qtest.py                  |  13 +-
python/qemu/qmp/error.py                      |   7 +-
python/qemu/qmp/events.py                     |  72 +++--
python/qemu/qmp/legacy.py                     |  31 +-
python/qemu/qmp/message.py                    |  38 +--
python/qemu/qmp/models.py                     |  17 +-
python/qemu/qmp/protocol.py                   | 179 +++++++-----
python/qemu/qmp/qmp_client.py                 | 147 +++++++---
python/qemu/qmp/qmp_shell.py                  | 182 ++++++++----
python/qemu/qmp/qmp_tui.py                    |  55 ++--
python/qemu/qmp/util.py                       | 116 +-------
python/qemu/utils/accel.py                    |   6 +-
python/qemu/utils/qemu_ga_client.py           |  13 +-
python/qemu/utils/qom_common.py               |  15 +-
python/qemu/utils/qom_fuse.py                 |  12 +-
python/scripts/mkvenv.py                      |  40 ++-
python/setup.cfg                              |   6 +-
python/setup.py                               |  40 ---
python/tests/minreqs.txt                      |   2 +-
python/tests/protocol.py                      |  11 +-
roms/edk2-build.py                            |  19 +-
scripts/analyse-9p-simpletrace.py             |   2 +
scripts/analyse-locks-simpletrace.py          |   5 +-
scripts/analyze-migration.py                  |  48 ++--
scripts/block-coroutine-wrapper.py            |   4 +-
scripts/check_sparse.py                       |   9 +-
scripts/ci/gitlab-pipeline-status             |   4 +-
.../codeconverter/codeconverter/patching.py   |  76 ++---
.../codeconverter/codeconverter/qom_macros.py |  98 +++++--
.../codeconverter/qom_type_info.py            |  86 ++++--
.../codeconverter/codeconverter/regexps.py    |   5 +-
.../codeconverter/test_patching.py            |   6 +-
.../codeconverter/test_regexps.py             |  33 ++-
scripts/codeconverter/codeconverter/utils.py  |  10 +-
scripts/codeconverter/converter.py            |  16 +-
scripts/compare-machine-types.py              |  49 ++--
scripts/coverage/compare_gcov_json.py         |   7 +-
scripts/cpu-x86-uarch-abi.py                  |   6 +-
scripts/decodetree.py                         |  12 +-
scripts/device-crash-test                     |  18 +-
scripts/dump-guest-memory.py                  |   5 +-
scripts/feature_to_c.py                       |   7 +-
scripts/kvm/kvm_flightrecorder                |   7 +-
scripts/kvm/vmxcap                            |   6 +-
scripts/meson-buildoptions.py                 |   3 +-
scripts/minikconf.py                          |  13 +-
scripts/modinfo-collect.py                    |   7 +-
scripts/modinfo-generate.py                   |   4 +-
scripts/modules/module_block.py               |   5 +-
scripts/mtest2make.py                         |   8 +-
scripts/oss-fuzz/minimize_qtest_trace.py      |  18 +-
scripts/oss-fuzz/output_reproducer.py         |  18 +-
.../oss-fuzz/reorder_fuzzer_qtest_trace.py    |   6 +-
scripts/performance/dissect.py                |   2 +-
scripts/performance/topN_callgrind.py         |   2 +-
scripts/performance/topN_perf.py              |   2 +-
scripts/probe-gdb-support.py                  |   4 +-
scripts/python_qmp_updater.py                 |   1 +
scripts/qapi-gen.py                           |   1 +
scripts/qapi/commands.py                      |  13 +-
scripts/qapi/common.py                        |  61 ++--
scripts/qapi/error.py                         |   1 -
scripts/qapi/events.py                        |   8 +-
scripts/qapi/expr.py                          |  21 +-
scripts/qapi/features.py                      |   2 +-
scripts/qapi/gen.py                           |  14 +-
scripts/qapi/introspect.py                    |  42 ++-
scripts/qapi/parser.py                        |  44 ++-
scripts/qapi/schema.py                        | 271 +++++++++---------
scripts/qapi/source.py                        |  10 +-
scripts/qapi/types.py                         |  20 +-
scripts/qapi/visit.py                         |  14 +-
scripts/qcow2-to-stdout.py                    |   8 +-
scripts/qemu-gdb.py                           |  13 +-
scripts/qemu-plugin-symbols.py                |   4 +-
scripts/qemu-stamp.py                         |   1 +
scripts/qemu-trace-stap                       |   1 -
scripts/qemugdb/aio.py                        |   1 +
scripts/qemugdb/coroutine.py                  |   1 +
scripts/qemugdb/mtree.py                      |   1 +
scripts/qemugdb/tcg.py                        |   2 +-
scripts/qemugdb/timers.py                     |   2 +-
scripts/qmp/qemu-ga-client                    |   1 +
scripts/qmp/qmp                               |   1 +
scripts/qmp/qmp-shell                         |   1 +
scripts/qmp/qmp-shell-wrap                    |   1 +
scripts/qmp/qom-fuse                          |   1 +
scripts/qmp/qom-get                           |   1 +
scripts/qmp/qom-list                          |   1 +
scripts/qmp/qom-set                           |   1 +
scripts/qmp/qom-tree                          |   1 +
scripts/qom-cast-macro-clean-cocci-gen.py     |   3 +-
scripts/render_block_graph.py                 |  28 +-
scripts/replay-dump.py                        |  10 +-
scripts/rust/rustc_args.py                    |  10 +-
scripts/shaderinclude.py                      |   4 +-
scripts/signrom.py                            |   3 +-
scripts/simplebench/bench-backup.py           |   9 +-
scripts/simplebench/bench-example.py          |   4 +-
scripts/simplebench/bench_block_job.py        |   9 +-
scripts/simplebench/bench_prealloc.py         |  10 +-
scripts/simplebench/bench_write_req.py        |   5 +-
scripts/simplebench/img_bench_templater.py    |  10 +-
scripts/simplebench/results_to_text.py        |   4 +-
scripts/simplebench/simplebench.py            |   2 +-
scripts/simplebench/table_templater.py        |   4 +-
scripts/simpletrace.py                        |  16 +-
scripts/symlink-install-tree.py               |   3 +-
scripts/tracetool.py                          |   5 +-
scripts/tracetool/__init__.py                 |  11 +-
scripts/tracetool/backend/__init__.py         |   2 -
scripts/tracetool/backend/dtrace.py           |   2 -
scripts/tracetool/backend/ftrace.py           |   2 -
scripts/tracetool/backend/log.py              |   2 -
scripts/tracetool/backend/simple.py           |   2 -
scripts/tracetool/backend/syslog.py           |   2 -
scripts/tracetool/backend/ust.py              |   2 -
scripts/tracetool/format/__init__.py          |   2 -
scripts/tracetool/format/c.py                 |   2 -
scripts/tracetool/format/d.py                 |   5 +-
scripts/tracetool/format/h.py                 |   2 -
scripts/tracetool/format/log_stap.py          |   3 +-
scripts/tracetool/format/simpletrace_stap.py  |   3 +-
scripts/tracetool/format/stap.py              |   2 -
scripts/tracetool/format/ust_events_c.py      |   2 -
scripts/tracetool/format/ust_events_h.py      |   2 -
scripts/u2f-setup-gen.py                      |  15 +-
scripts/undefsym.py                           |   3 +-
scripts/userfaultfd-wrlat.py                  |  10 +-
scripts/vmstate-static-checker.py             |   1 +
scripts/xml-preprocess-test.py                |   3 +-
scripts/xml-preprocess.py                     |   4 +-
target/hexagon/gen_analyze_funcs.py           |   3 -
target/hexagon/gen_decodetree.py              |   9 +-
target/hexagon/gen_helper_funcs.py            |   3 -
target/hexagon/gen_helper_protos.py           |   4 +-
target/hexagon/gen_idef_parser_funcs.py       |   4 -
target/hexagon/gen_op_attribs.py              |   6 +-
target/hexagon/gen_opcodes_def.py             |   6 +-
target/hexagon/gen_printinsn.py               |   5 +-
target/hexagon/gen_tcg_func_table.py          |   6 +-
target/hexagon/gen_tcg_funcs.py               |   3 -
target/hexagon/gen_trans_funcs.py             |   8 +-
target/hexagon/hex_common.py                  |  15 +-
tests/docker/docker.py                        |  37 ++-
tests/functional/aspeed.py                    |   4 +-
tests/functional/qemu_test/__init__.py        |  30 +-
tests/functional/qemu_test/archive.py         |   2 +-
tests/functional/qemu_test/asset.py           |  10 +-
tests/functional/qemu_test/decorators.py      |   1 +
tests/functional/qemu_test/linuxkernel.py     |   5 +-
tests/functional/qemu_test/ports.py           |   3 +-
tests/functional/qemu_test/testcase.py        |   2 +-
tests/functional/qemu_test/tuxruntest.py      |  12 +-
tests/functional/qemu_test/uncompress.py      |   4 +-
tests/functional/replay_kernel.py             |   7 +-
tests/functional/reverse_debugging.py         |   5 +-
.../functional/test_aarch64_aspeed_ast2700.py |   9 +-
.../test_aarch64_aspeed_ast2700fc.py          |   9 +-
tests/functional/test_aarch64_imx8mp_evk.py   |   4 +-
tests/functional/test_aarch64_raspi3.py       |   2 +-
tests/functional/test_aarch64_raspi4.py       |   7 +-
tests/functional/test_aarch64_replay.py       |   4 +-
.../functional/test_aarch64_reverse_debug.py  |   2 +-
tests/functional/test_aarch64_rme_sbsaref.py  |   8 +-
tests/functional/test_aarch64_rme_virt.py     |  11 +-
tests/functional/test_aarch64_sbsaref.py      |   9 +-
.../functional/test_aarch64_sbsaref_alpine.py |   8 +-
.../test_aarch64_sbsaref_freebsd.py           |   8 +-
tests/functional/test_aarch64_smmu.py         |   8 +-
tests/functional/test_aarch64_tcg_plugins.py  |   4 +-
tests/functional/test_aarch64_tuxrun.py       |   1 +
tests/functional/test_aarch64_virt.py         |  11 +-
tests/functional/test_aarch64_virt_gpu.py     |   7 +-
tests/functional/test_aarch64_xlnx_versal.py  |   3 +-
tests/functional/test_acpi_bits.py            |  21 +-
tests/functional/test_alpha_clipper.py        |   2 +-
tests/functional/test_arm_aspeed_ast1030.py   |   7 +-
tests/functional/test_arm_aspeed_ast2500.py   |   2 +-
tests/functional/test_arm_aspeed_ast2600.py   |  11 +-
tests/functional/test_arm_aspeed_bletchley.py |   2 +-
tests/functional/test_arm_aspeed_palmetto.py  |   2 +-
tests/functional/test_arm_aspeed_rainier.py   |   3 +-
tests/functional/test_arm_aspeed_romulus.py   |   2 +-
.../functional/test_arm_aspeed_witherspoon.py |   2 +-
tests/functional/test_arm_bflt.py             |   8 +-
tests/functional/test_arm_bpim2u.py           |  10 +-
tests/functional/test_arm_canona1100.py       |   3 +-
tests/functional/test_arm_collie.py           |   2 +-
tests/functional/test_arm_cubieboard.py       |  10 +-
tests/functional/test_arm_emcraft_sf2.py      |   7 +-
tests/functional/test_arm_integratorcp.py     |  12 +-
tests/functional/test_arm_microbit.py         |   8 +-
tests/functional/test_arm_orangepi.py         |  11 +-
tests/functional/test_arm_quanta_gsj.py       |   9 +-
tests/functional/test_arm_raspi2.py           |   7 +-
tests/functional/test_arm_smdkc210.py         |   2 +-
tests/functional/test_arm_stellaris.py        |   8 +-
tests/functional/test_arm_sx1.py              |   2 +-
tests/functional/test_arm_tuxrun.py           |   1 +
tests/functional/test_arm_vexpress.py         |   2 +-
tests/functional/test_arm_virt.py             |   3 +-
tests/functional/test_avr_mega2560.py         |   2 +-
tests/functional/test_avr_uno.py              |   2 +-
tests/functional/test_cpu_queries.py          |   1 +
tests/functional/test_empty_cpu_model.py      |   1 +
tests/functional/test_hppa_seabios.py         |   4 +-
tests/functional/test_i386_tuxrun.py          |   1 +
tests/functional/test_intel_iommu.py          |   6 +-
tests/functional/test_linux_initrd.py         |   2 +-
tests/functional/test_loongarch64_virt.py     |  10 +-
tests/functional/test_m68k_mcf5208evb.py      |   2 +-
tests/functional/test_m68k_nextcube.py        |   8 +-
tests/functional/test_m68k_q800.py            |   3 +-
tests/functional/test_m68k_tuxrun.py          |   1 +
tests/functional/test_mem_addr_space.py       |   4 +-
tests/functional/test_memlock.py              |   9 +-
.../functional/test_microblaze_s3adsp1800.py  |   9 +-
tests/functional/test_mips64_malta.py         |   2 +-
tests/functional/test_mips64_tuxrun.py        |   1 +
tests/functional/test_mips64el_fuloong2e.py   |  11 +-
tests/functional/test_mips64el_loongson3v.py  |   8 +-
tests/functional/test_mips64el_malta.py       |  17 +-
tests/functional/test_mips64el_tuxrun.py      |   1 +
tests/functional/test_mips_malta.py           |   8 +-
tests/functional/test_mips_tuxrun.py          |   1 +
tests/functional/test_mipsel_malta.py         |  11 +-
tests/functional/test_mipsel_tuxrun.py        |   1 +
tests/functional/test_multiprocess.py         |  10 +-
tests/functional/test_netdev_ethtool.py       |   5 +-
tests/functional/test_or1k_sim.py             |   2 +-
tests/functional/test_pc_cpu_hotplug_props.py |   1 +
tests/functional/test_ppc64_e500.py           |   7 +-
tests/functional/test_ppc64_hv.py             |  16 +-
tests/functional/test_ppc64_mac99.py          |   8 +-
tests/functional/test_ppc64_powernv.py        |   4 +-
tests/functional/test_ppc64_pseries.py        |   4 +-
tests/functional/test_ppc64_reverse_debug.py  |   2 +-
tests/functional/test_ppc64_tuxrun.py         |   3 +-
tests/functional/test_ppc_40p.py              |  10 +-
tests/functional/test_ppc_74xx.py             |   4 +-
tests/functional/test_ppc_amiga.py            |   3 +-
tests/functional/test_ppc_bamboo.py           |   9 +-
tests/functional/test_ppc_mac.py              |   2 +-
tests/functional/test_ppc_mpc8544ds.py        |   3 +-
tests/functional/test_ppc_sam460ex.py         |   7 +-
tests/functional/test_ppc_tuxrun.py           |   1 +
tests/functional/test_ppc_virtex_ml507.py     |   3 +-
tests/functional/test_riscv32_tuxrun.py       |   1 +
tests/functional/test_riscv64_tuxrun.py       |   1 +
tests/functional/test_riscv_opensbi.py        |   4 +-
tests/functional/test_rx_gdbsim.py            |  10 +-
tests/functional/test_s390x_ccw_virtio.py     |   9 +-
tests/functional/test_s390x_topology.py       |  11 +-
tests/functional/test_s390x_tuxrun.py         |   1 +
tests/functional/test_sh4_r2d.py              |   2 +-
tests/functional/test_sh4_tuxrun.py           |   1 +
tests/functional/test_sh4eb_r2d.py            |   7 +-
tests/functional/test_sparc64_sun4u.py        |   3 +-
tests/functional/test_sparc64_tuxrun.py       |   1 +
tests/functional/test_sparc_sun4m.py          |   2 +-
tests/functional/test_virtio_balloon.py       |  10 +-
tests/functional/test_virtio_gpu.py           |  14 +-
tests/functional/test_virtio_version.py       |   1 +
tests/functional/test_x86_64_hotplug_blk.py   |   6 +-
tests/functional/test_x86_64_hotplug_cpu.py   |   6 +-
tests/functional/test_x86_64_kvm_xen.py       |   8 +-
tests/functional/test_x86_64_replay.py        |   4 +-
tests/functional/test_x86_64_reverse_debug.py |   2 +-
tests/functional/test_x86_64_tuxrun.py        |   1 +
.../functional/test_x86_cpu_model_versions.py |  13 +-
tests/functional/test_xtensa_lx60.py          |   2 +-
tests/guest-debug/run-test.py                 |   9 +-
tests/guest-debug/test_gdbstub.py             |  15 +-
tests/image-fuzzer/qcow2/fuzz.py              |   3 +-
tests/image-fuzzer/qcow2/layout.py            |  32 ++-
tests/image-fuzzer/runner.py                  |  19 +-
tests/lcitool/refresh                         |   6 +-
tests/migration-stress/guestperf-batch.py     |   1 +
tests/migration-stress/guestperf-plot.py      |   1 +
tests/migration-stress/guestperf.py           |   1 +
.../migration-stress/guestperf/comparison.py  |   3 +-
tests/migration-stress/guestperf/engine.py    |   8 +-
tests/migration-stress/guestperf/hardware.py  |   2 +-
tests/migration-stress/guestperf/plot.py      |   4 +-
tests/migration-stress/guestperf/progress.py  |   4 +-
tests/migration-stress/guestperf/report.py    |   9 +-
tests/migration-stress/guestperf/scenario.py  |   2 +-
tests/migration-stress/guestperf/shell.py     |  18 +-
tests/migration-stress/guestperf/timings.py   |   4 +-
tests/qapi-schema/test-qapi.py                |   2 +-
tests/qemu-iotests/030                        |   6 +-
tests/qemu-iotests/040                        |   6 +-
tests/qemu-iotests/041                        |   7 +-
tests/qemu-iotests/044                        |  11 +-
tests/qemu-iotests/045                        |  10 +-
tests/qemu-iotests/055                        |   4 +-
tests/qemu-iotests/056                        |   6 +-
tests/qemu-iotests/057                        |   5 +-
tests/qemu-iotests/065                        |  10 +-
tests/qemu-iotests/093                        |   9 +-
tests/qemu-iotests/096                        |   4 +-
tests/qemu-iotests/118                        |   4 +-
tests/qemu-iotests/124                        |   8 +-
tests/qemu-iotests/129                        |   2 +
tests/qemu-iotests/132                        |   3 +-
tests/qemu-iotests/136                        |   4 +-
tests/qemu-iotests/139                        |   3 +-
tests/qemu-iotests/141                        |   1 +
tests/qemu-iotests/147                        |  13 +-
tests/qemu-iotests/148                        |   2 +
tests/qemu-iotests/149                        |   7 +-
tests/qemu-iotests/151                        |   6 +-
tests/qemu-iotests/152                        |   2 +
tests/qemu-iotests/155                        |   2 +
tests/qemu-iotests/163                        |  11 +-
tests/qemu-iotests/165                        |   3 +-
tests/qemu-iotests/194                        |   7 +-
tests/qemu-iotests/196                        |   2 +
tests/qemu-iotests/202                        |   1 +
tests/qemu-iotests/203                        |   1 +
tests/qemu-iotests/205                        |  11 +-
tests/qemu-iotests/206                        |   1 +
tests/qemu-iotests/207                        |   6 +-
tests/qemu-iotests/208                        |   1 +
tests/qemu-iotests/209                        |  11 +-
tests/qemu-iotests/210                        |   1 +
tests/qemu-iotests/211                        |   1 +
tests/qemu-iotests/212                        |   1 +
tests/qemu-iotests/213                        |   1 +
tests/qemu-iotests/216                        |   1 +
tests/qemu-iotests/218                        |   1 +
tests/qemu-iotests/219                        |   1 +
tests/qemu-iotests/224                        |  13 +-
tests/qemu-iotests/228                        |  11 +-
tests/qemu-iotests/234                        |   4 +-
tests/qemu-iotests/235                        |  14 +-
tests/qemu-iotests/236                        |   1 +
tests/qemu-iotests/237                        |   2 +
tests/qemu-iotests/238                        |   3 +-
tests/qemu-iotests/240                        |   2 +-
tests/qemu-iotests/242                        |  23 +-
tests/qemu-iotests/245                        |   1 +
tests/qemu-iotests/246                        |   1 +
tests/qemu-iotests/248                        |  12 +-
tests/qemu-iotests/254                        |   3 +-
tests/qemu-iotests/255                        |   1 +
tests/qemu-iotests/256                        |   4 +-
tests/qemu-iotests/257                        |  28 +-
tests/qemu-iotests/258                        |  10 +-
tests/qemu-iotests/260                        |   8 +-
tests/qemu-iotests/262                        |   4 +-
tests/qemu-iotests/264                        |   7 +-
tests/qemu-iotests/274                        |   1 +
tests/qemu-iotests/277                        |  10 +-
tests/qemu-iotests/280                        |   2 +-
tests/qemu-iotests/281                        |   4 +-
tests/qemu-iotests/283                        |   1 +
tests/qemu-iotests/295                        |   6 +-
tests/qemu-iotests/296                        |   7 +-
tests/qemu-iotests/297                        |   8 +-
tests/qemu-iotests/298                        |   2 +
tests/qemu-iotests/299                        |   1 +
tests/qemu-iotests/300                        |  10 +-
tests/qemu-iotests/302                        |   4 +-
tests/qemu-iotests/303                        |  13 +-
tests/qemu-iotests/304                        |   3 +-
tests/qemu-iotests/307                        |   2 +-
tests/qemu-iotests/310                        |   1 +
tests/qemu-iotests/check                      |   7 +-
tests/qemu-iotests/fat16.py                   |  12 +-
tests/qemu-iotests/findtests.py               |  19 +-
tests/qemu-iotests/iotests.py                 |  70 +++--
tests/qemu-iotests/linters.py                 |   9 +-
tests/qemu-iotests/nbd-fault-injector.py      |  13 +-
tests/qemu-iotests/qcow2.py                   |   5 +-
tests/qemu-iotests/qcow2_format.py            |  14 +-
tests/qemu-iotests/qed.py                     |  10 +-
tests/qemu-iotests/testenv.py                 |  25 +-
tests/qemu-iotests/testrunner.py              |  32 +--
tests/qemu-iotests/tests/block-status-cache   |   1 +
.../tests/export-incoming-iothread            |   1 +
.../qemu-iotests/tests/graph-changes-while-io |  11 +-
tests/qemu-iotests/tests/image-fleecing       |   1 +
tests/qemu-iotests/tests/inactive-node-nbd    |   8 +-
.../tests/iothreads-commit-active             |   2 +
tests/qemu-iotests/tests/iothreads-create     |   2 +
tests/qemu-iotests/tests/iothreads-nbd-export |   3 +
tests/qemu-iotests/tests/iothreads-stream     |   2 +
tests/qemu-iotests/tests/luks-detached-header |   5 +-
.../tests/migrate-bitmaps-postcopy-test       |  10 +-
tests/qemu-iotests/tests/migrate-bitmaps-test |   2 +-
.../qemu-iotests/tests/migrate-during-backup  |   1 +
.../tests/mirror-change-copy-mode             |   3 +-
.../tests/mirror-ready-cancel-error           |   1 +
tests/qemu-iotests/tests/nbd-multiconn        |   2 +-
.../qemu-iotests/tests/nbd-reconnect-on-open  |  11 +-
.../qemu-iotests/tests/parallels-read-bitmap  |   8 +-
tests/qemu-iotests/tests/qsd-migrate          |   2 +-
.../tests/remove-bitmap-from-backing          |   8 +-
tests/qemu-iotests/tests/reopen-file          |   3 +-
.../qemu-iotests/tests/stream-error-on-reset  |   8 +-
.../tests/stream-unaligned-prefetch           |  13 +-
.../qemu-iotests/tests/stream-under-throttle  |   4 +-
tests/qemu-iotests/tests/vvfat                |   7 +-
tests/tcg/aarch64/gdbstub/test-mte.py         |   2 +-
tests/tcg/aarch64/gdbstub/test-sve-ioctl.py   |   4 +-
tests/tcg/aarch64/gdbstub/test-sve.py         |   2 +-
tests/tcg/i386/test-avx.py                    |  11 +-
tests/tcg/i386/test-mmx.py                    |   9 +-
tests/tcg/multiarch/gdbstub/catch-syscalls.py |   6 +-
.../gdbstub/follow-fork-mode-child.py         |   4 +-
.../gdbstub/follow-fork-mode-parent.py        |   2 +-
tests/tcg/multiarch/gdbstub/interrupt.py      |   1 -
tests/tcg/multiarch/gdbstub/late-attach.py    |   4 +-
tests/tcg/multiarch/gdbstub/memory.py         |   2 -
tests/tcg/multiarch/gdbstub/prot-none.py      |   5 +-
tests/tcg/multiarch/gdbstub/registers.py      |   3 +-
tests/tcg/multiarch/gdbstub/sha1.py           |   1 -
.../multiarch/gdbstub/test-proc-mappings.py   |   1 -
.../multiarch/gdbstub/test-qxfer-auxv-read.py |   1 -
.../gdbstub/test-qxfer-siginfo-read.py        |   2 +-
.../gdbstub/test-thread-breakpoint.py         |   1 -
.../system/validate-memory-counts.py          |   7 +-
tests/tcg/s390x/gdbstub/test-signals-s390x.py |   2 -
tests/tcg/s390x/gdbstub/test-svc.py           |   1 -
tests/vm/aarch64vm.py                         |  16 +-
tests/vm/basevm.py                            |  37 +--
tests/vm/centos.aarch64                       |  11 +-
tests/vm/freebsd                              |   7 +-
tests/vm/haiku.x86_64                         |   7 +-
tests/vm/netbsd                               |   5 +-
tests/vm/openbsd                              |   5 +-
tests/vm/ubuntu.aarch64                       |   6 +-
tests/vm/ubuntuvm.py                          |   6 +-
456 files changed, 2624 insertions(+), 2058 deletions(-)
create mode 100644 python/pyproject.toml
delete mode 100755 python/setup.py
[PATCH v2 00/12] Python: Fix 'make check-dev' and modernize to 3.9+
Posted by John Snow 5 months ago
This series does a couple things that I'll probably end up splitting out
into smaller series if history is any guide, but either way, here it
goes:

A) Convert qemu.git/python/ to a PEP517/pyproject.toml
package. Ultimately this means deleting setup.py and fully migrating to
newer python infrastructure. I think this should be safe to do by now,
but admittedly I am not *confident* as it relies on setuptools versions
in the wild, not python versions. My motivation for trying it is to fix
"make check-dev", which has been broken for the last two Fedora releases
under newer setuptools which have started removing support for the
pre-PEP517 packaging formats, which will only continue to get worse from
here on out.

B) Sync changes from the qemu.qmp package back over to qemu.git. I know
I need to decouple this badly, but in order to do so, I need to make
sure they're synchronized to be assured that the switch to the
standalone version won't break anything, so this is a necessary
step. It's happening here because of the 3.6+ compat crud we are still
carrying in qemu.git that has since been removed from the standalone
library.

C) Move us to 3.9+ style type hints. They are deprecated in 3.9, and
*could* be removed at any time. I figured now was a good time as any to
get rid of them before they become a problem randomly some day in the
future.

D) Update the mypy configuration to check under multiple Python versions
more effectively and thoroughly.

Whew.

v2:
 - Perform the 3.9+ syntax conversion using automated tooling instead
 - Correct illegal escape sequences (pyupgrade whines otherwise)
 - Use the correct shebang for all python scripts in tree
 - Remove asterisk imports from scripts/codeconverter
 - rebased on origin/master

John Snow (12):
  python: convert packages to PEP517/pyproject.toml
  python: update pylint ignores
  python: sync changes from external qemu.qmp package
  python: update shebangs to standard, using /usr/bin/env
  python: fix illegal escape sequences
  python: upgrade to python3.9+ syntax
  fixup
  python: further 3.9+ syntax upgrades
  python: update mkvenv to type-check under different python versions
  python: remove version restriction for mypy
  scripts/codeconverter: remove unused code
  scripts/codeconverter: remove * imports

 docs/conf.py                                  |  13 +-
 docs/sphinx/compat.py                         |  12 +-
 docs/sphinx/dbusdoc.py                        |  28 +-
 docs/sphinx/dbusdomain.py                     |  39 +--
 docs/sphinx/dbusparser.py                     |   4 +-
 docs/sphinx/depfile.py                        |  11 +-
 docs/sphinx/fakedbusdoc.py                    |   5 +-
 docs/sphinx/hxtool.py                         |   7 +-
 docs/sphinx/kerneldoc.py                      |   8 +-
 docs/sphinx/qapi_domain.py                    |  81 +++---
 docs/sphinx/qapidoc.py                        |  29 +-
 docs/sphinx/qapidoc_legacy.py                 |   1 -
 docs/sphinx/qmp_lexer.py                      |   7 +-
 python/README.rst                             |  33 ++-
 .gitlab-ci.d/check-dco.py                     |   9 +-
 .gitlab-ci.d/check-patch.py                   |   7 +-
 .gitlab-ci.d/check-units.py                   |   8 +-
 python/Makefile                               |  18 +-
 python/pyproject.toml                         |  10 +
 python/qemu/machine/console_socket.py         |   6 +-
 python/qemu/machine/machine.py                |  34 +--
 python/qemu/machine/qtest.py                  |  13 +-
 python/qemu/qmp/error.py                      |   7 +-
 python/qemu/qmp/events.py                     |  72 +++--
 python/qemu/qmp/legacy.py                     |  31 +-
 python/qemu/qmp/message.py                    |  38 +--
 python/qemu/qmp/models.py                     |  17 +-
 python/qemu/qmp/protocol.py                   | 179 +++++++-----
 python/qemu/qmp/qmp_client.py                 | 147 +++++++---
 python/qemu/qmp/qmp_shell.py                  | 182 ++++++++----
 python/qemu/qmp/qmp_tui.py                    |  55 ++--
 python/qemu/qmp/util.py                       | 116 +-------
 python/qemu/utils/accel.py                    |   6 +-
 python/qemu/utils/qemu_ga_client.py           |  13 +-
 python/qemu/utils/qom_common.py               |  15 +-
 python/qemu/utils/qom_fuse.py                 |  12 +-
 python/scripts/mkvenv.py                      |  40 ++-
 python/setup.cfg                              |   6 +-
 python/setup.py                               |  40 ---
 python/tests/minreqs.txt                      |   2 +-
 python/tests/protocol.py                      |  11 +-
 roms/edk2-build.py                            |  19 +-
 scripts/analyse-9p-simpletrace.py             |   2 +
 scripts/analyse-locks-simpletrace.py          |   5 +-
 scripts/analyze-migration.py                  |  48 ++--
 scripts/block-coroutine-wrapper.py            |   4 +-
 scripts/check_sparse.py                       |   9 +-
 scripts/ci/gitlab-pipeline-status             |   4 +-
 .../codeconverter/codeconverter/patching.py   |  76 ++---
 .../codeconverter/codeconverter/qom_macros.py |  98 +++++--
 .../codeconverter/qom_type_info.py            |  86 ++++--
 .../codeconverter/codeconverter/regexps.py    |   5 +-
 .../codeconverter/test_patching.py            |   6 +-
 .../codeconverter/test_regexps.py             |  33 ++-
 scripts/codeconverter/codeconverter/utils.py  |  10 +-
 scripts/codeconverter/converter.py            |  16 +-
 scripts/compare-machine-types.py              |  49 ++--
 scripts/coverage/compare_gcov_json.py         |   7 +-
 scripts/cpu-x86-uarch-abi.py                  |   6 +-
 scripts/decodetree.py                         |  12 +-
 scripts/device-crash-test                     |  18 +-
 scripts/dump-guest-memory.py                  |   5 +-
 scripts/feature_to_c.py                       |   7 +-
 scripts/kvm/kvm_flightrecorder                |   7 +-
 scripts/kvm/vmxcap                            |   6 +-
 scripts/meson-buildoptions.py                 |   3 +-
 scripts/minikconf.py                          |  13 +-
 scripts/modinfo-collect.py                    |   7 +-
 scripts/modinfo-generate.py                   |   4 +-
 scripts/modules/module_block.py               |   5 +-
 scripts/mtest2make.py                         |   8 +-
 scripts/oss-fuzz/minimize_qtest_trace.py      |  18 +-
 scripts/oss-fuzz/output_reproducer.py         |  18 +-
 .../oss-fuzz/reorder_fuzzer_qtest_trace.py    |   6 +-
 scripts/performance/dissect.py                |   2 +-
 scripts/performance/topN_callgrind.py         |   2 +-
 scripts/performance/topN_perf.py              |   2 +-
 scripts/probe-gdb-support.py                  |   4 +-
 scripts/python_qmp_updater.py                 |   1 +
 scripts/qapi-gen.py                           |   1 +
 scripts/qapi/commands.py                      |  13 +-
 scripts/qapi/common.py                        |  61 ++--
 scripts/qapi/error.py                         |   1 -
 scripts/qapi/events.py                        |   8 +-
 scripts/qapi/expr.py                          |  21 +-
 scripts/qapi/features.py                      |   2 +-
 scripts/qapi/gen.py                           |  14 +-
 scripts/qapi/introspect.py                    |  42 ++-
 scripts/qapi/parser.py                        |  44 ++-
 scripts/qapi/schema.py                        | 271 +++++++++---------
 scripts/qapi/source.py                        |  10 +-
 scripts/qapi/types.py                         |  20 +-
 scripts/qapi/visit.py                         |  14 +-
 scripts/qcow2-to-stdout.py                    |   8 +-
 scripts/qemu-gdb.py                           |  13 +-
 scripts/qemu-plugin-symbols.py                |   4 +-
 scripts/qemu-stamp.py                         |   1 +
 scripts/qemu-trace-stap                       |   1 -
 scripts/qemugdb/aio.py                        |   1 +
 scripts/qemugdb/coroutine.py                  |   1 +
 scripts/qemugdb/mtree.py                      |   1 +
 scripts/qemugdb/tcg.py                        |   2 +-
 scripts/qemugdb/timers.py                     |   2 +-
 scripts/qmp/qemu-ga-client                    |   1 +
 scripts/qmp/qmp                               |   1 +
 scripts/qmp/qmp-shell                         |   1 +
 scripts/qmp/qmp-shell-wrap                    |   1 +
 scripts/qmp/qom-fuse                          |   1 +
 scripts/qmp/qom-get                           |   1 +
 scripts/qmp/qom-list                          |   1 +
 scripts/qmp/qom-set                           |   1 +
 scripts/qmp/qom-tree                          |   1 +
 scripts/qom-cast-macro-clean-cocci-gen.py     |   3 +-
 scripts/render_block_graph.py                 |  28 +-
 scripts/replay-dump.py                        |  10 +-
 scripts/rust/rustc_args.py                    |  10 +-
 scripts/shaderinclude.py                      |   4 +-
 scripts/signrom.py                            |   3 +-
 scripts/simplebench/bench-backup.py           |   9 +-
 scripts/simplebench/bench-example.py          |   4 +-
 scripts/simplebench/bench_block_job.py        |   9 +-
 scripts/simplebench/bench_prealloc.py         |  10 +-
 scripts/simplebench/bench_write_req.py        |   5 +-
 scripts/simplebench/img_bench_templater.py    |  10 +-
 scripts/simplebench/results_to_text.py        |   4 +-
 scripts/simplebench/simplebench.py            |   2 +-
 scripts/simplebench/table_templater.py        |   4 +-
 scripts/simpletrace.py                        |  16 +-
 scripts/symlink-install-tree.py               |   3 +-
 scripts/tracetool.py                          |   5 +-
 scripts/tracetool/__init__.py                 |  11 +-
 scripts/tracetool/backend/__init__.py         |   2 -
 scripts/tracetool/backend/dtrace.py           |   2 -
 scripts/tracetool/backend/ftrace.py           |   2 -
 scripts/tracetool/backend/log.py              |   2 -
 scripts/tracetool/backend/simple.py           |   2 -
 scripts/tracetool/backend/syslog.py           |   2 -
 scripts/tracetool/backend/ust.py              |   2 -
 scripts/tracetool/format/__init__.py          |   2 -
 scripts/tracetool/format/c.py                 |   2 -
 scripts/tracetool/format/d.py                 |   5 +-
 scripts/tracetool/format/h.py                 |   2 -
 scripts/tracetool/format/log_stap.py          |   3 +-
 scripts/tracetool/format/simpletrace_stap.py  |   3 +-
 scripts/tracetool/format/stap.py              |   2 -
 scripts/tracetool/format/ust_events_c.py      |   2 -
 scripts/tracetool/format/ust_events_h.py      |   2 -
 scripts/u2f-setup-gen.py                      |  15 +-
 scripts/undefsym.py                           |   3 +-
 scripts/userfaultfd-wrlat.py                  |  10 +-
 scripts/vmstate-static-checker.py             |   1 +
 scripts/xml-preprocess-test.py                |   3 +-
 scripts/xml-preprocess.py                     |   4 +-
 target/hexagon/gen_analyze_funcs.py           |   3 -
 target/hexagon/gen_decodetree.py              |   9 +-
 target/hexagon/gen_helper_funcs.py            |   3 -
 target/hexagon/gen_helper_protos.py           |   4 +-
 target/hexagon/gen_idef_parser_funcs.py       |   4 -
 target/hexagon/gen_op_attribs.py              |   6 +-
 target/hexagon/gen_opcodes_def.py             |   6 +-
 target/hexagon/gen_printinsn.py               |   5 +-
 target/hexagon/gen_tcg_func_table.py          |   6 +-
 target/hexagon/gen_tcg_funcs.py               |   3 -
 target/hexagon/gen_trans_funcs.py             |   8 +-
 target/hexagon/hex_common.py                  |  15 +-
 tests/docker/docker.py                        |  37 ++-
 tests/functional/aspeed.py                    |   4 +-
 tests/functional/qemu_test/__init__.py        |  30 +-
 tests/functional/qemu_test/archive.py         |   2 +-
 tests/functional/qemu_test/asset.py           |  10 +-
 tests/functional/qemu_test/decorators.py      |   1 +
 tests/functional/qemu_test/linuxkernel.py     |   5 +-
 tests/functional/qemu_test/ports.py           |   3 +-
 tests/functional/qemu_test/testcase.py        |   2 +-
 tests/functional/qemu_test/tuxruntest.py      |  12 +-
 tests/functional/qemu_test/uncompress.py      |   4 +-
 tests/functional/replay_kernel.py             |   7 +-
 tests/functional/reverse_debugging.py         |   5 +-
 .../functional/test_aarch64_aspeed_ast2700.py |   9 +-
 .../test_aarch64_aspeed_ast2700fc.py          |   9 +-
 tests/functional/test_aarch64_imx8mp_evk.py   |   4 +-
 tests/functional/test_aarch64_raspi3.py       |   2 +-
 tests/functional/test_aarch64_raspi4.py       |   7 +-
 tests/functional/test_aarch64_replay.py       |   4 +-
 .../functional/test_aarch64_reverse_debug.py  |   2 +-
 tests/functional/test_aarch64_rme_sbsaref.py  |   8 +-
 tests/functional/test_aarch64_rme_virt.py     |  11 +-
 tests/functional/test_aarch64_sbsaref.py      |   9 +-
 .../functional/test_aarch64_sbsaref_alpine.py |   8 +-
 .../test_aarch64_sbsaref_freebsd.py           |   8 +-
 tests/functional/test_aarch64_smmu.py         |   8 +-
 tests/functional/test_aarch64_tcg_plugins.py  |   4 +-
 tests/functional/test_aarch64_tuxrun.py       |   1 +
 tests/functional/test_aarch64_virt.py         |  11 +-
 tests/functional/test_aarch64_virt_gpu.py     |   7 +-
 tests/functional/test_aarch64_xlnx_versal.py  |   3 +-
 tests/functional/test_acpi_bits.py            |  21 +-
 tests/functional/test_alpha_clipper.py        |   2 +-
 tests/functional/test_arm_aspeed_ast1030.py   |   7 +-
 tests/functional/test_arm_aspeed_ast2500.py   |   2 +-
 tests/functional/test_arm_aspeed_ast2600.py   |  11 +-
 tests/functional/test_arm_aspeed_bletchley.py |   2 +-
 tests/functional/test_arm_aspeed_palmetto.py  |   2 +-
 tests/functional/test_arm_aspeed_rainier.py   |   3 +-
 tests/functional/test_arm_aspeed_romulus.py   |   2 +-
 .../functional/test_arm_aspeed_witherspoon.py |   2 +-
 tests/functional/test_arm_bflt.py             |   8 +-
 tests/functional/test_arm_bpim2u.py           |  10 +-
 tests/functional/test_arm_canona1100.py       |   3 +-
 tests/functional/test_arm_collie.py           |   2 +-
 tests/functional/test_arm_cubieboard.py       |  10 +-
 tests/functional/test_arm_emcraft_sf2.py      |   7 +-
 tests/functional/test_arm_integratorcp.py     |  12 +-
 tests/functional/test_arm_microbit.py         |   8 +-
 tests/functional/test_arm_orangepi.py         |  11 +-
 tests/functional/test_arm_quanta_gsj.py       |   9 +-
 tests/functional/test_arm_raspi2.py           |   7 +-
 tests/functional/test_arm_smdkc210.py         |   2 +-
 tests/functional/test_arm_stellaris.py        |   8 +-
 tests/functional/test_arm_sx1.py              |   2 +-
 tests/functional/test_arm_tuxrun.py           |   1 +
 tests/functional/test_arm_vexpress.py         |   2 +-
 tests/functional/test_arm_virt.py             |   3 +-
 tests/functional/test_avr_mega2560.py         |   2 +-
 tests/functional/test_avr_uno.py              |   2 +-
 tests/functional/test_cpu_queries.py          |   1 +
 tests/functional/test_empty_cpu_model.py      |   1 +
 tests/functional/test_hppa_seabios.py         |   4 +-
 tests/functional/test_i386_tuxrun.py          |   1 +
 tests/functional/test_intel_iommu.py          |   6 +-
 tests/functional/test_linux_initrd.py         |   2 +-
 tests/functional/test_loongarch64_virt.py     |  10 +-
 tests/functional/test_m68k_mcf5208evb.py      |   2 +-
 tests/functional/test_m68k_nextcube.py        |   8 +-
 tests/functional/test_m68k_q800.py            |   3 +-
 tests/functional/test_m68k_tuxrun.py          |   1 +
 tests/functional/test_mem_addr_space.py       |   4 +-
 tests/functional/test_memlock.py              |   9 +-
 .../functional/test_microblaze_s3adsp1800.py  |   9 +-
 tests/functional/test_mips64_malta.py         |   2 +-
 tests/functional/test_mips64_tuxrun.py        |   1 +
 tests/functional/test_mips64el_fuloong2e.py   |  11 +-
 tests/functional/test_mips64el_loongson3v.py  |   8 +-
 tests/functional/test_mips64el_malta.py       |  17 +-
 tests/functional/test_mips64el_tuxrun.py      |   1 +
 tests/functional/test_mips_malta.py           |   8 +-
 tests/functional/test_mips_tuxrun.py          |   1 +
 tests/functional/test_mipsel_malta.py         |  11 +-
 tests/functional/test_mipsel_tuxrun.py        |   1 +
 tests/functional/test_multiprocess.py         |  10 +-
 tests/functional/test_netdev_ethtool.py       |   5 +-
 tests/functional/test_or1k_sim.py             |   2 +-
 tests/functional/test_pc_cpu_hotplug_props.py |   1 +
 tests/functional/test_ppc64_e500.py           |   7 +-
 tests/functional/test_ppc64_hv.py             |  16 +-
 tests/functional/test_ppc64_mac99.py          |   8 +-
 tests/functional/test_ppc64_powernv.py        |   4 +-
 tests/functional/test_ppc64_pseries.py        |   4 +-
 tests/functional/test_ppc64_reverse_debug.py  |   2 +-
 tests/functional/test_ppc64_tuxrun.py         |   3 +-
 tests/functional/test_ppc_40p.py              |  10 +-
 tests/functional/test_ppc_74xx.py             |   4 +-
 tests/functional/test_ppc_amiga.py            |   3 +-
 tests/functional/test_ppc_bamboo.py           |   9 +-
 tests/functional/test_ppc_mac.py              |   2 +-
 tests/functional/test_ppc_mpc8544ds.py        |   3 +-
 tests/functional/test_ppc_sam460ex.py         |   7 +-
 tests/functional/test_ppc_tuxrun.py           |   1 +
 tests/functional/test_ppc_virtex_ml507.py     |   3 +-
 tests/functional/test_riscv32_tuxrun.py       |   1 +
 tests/functional/test_riscv64_tuxrun.py       |   1 +
 tests/functional/test_riscv_opensbi.py        |   4 +-
 tests/functional/test_rx_gdbsim.py            |  10 +-
 tests/functional/test_s390x_ccw_virtio.py     |   9 +-
 tests/functional/test_s390x_topology.py       |  11 +-
 tests/functional/test_s390x_tuxrun.py         |   1 +
 tests/functional/test_sh4_r2d.py              |   2 +-
 tests/functional/test_sh4_tuxrun.py           |   1 +
 tests/functional/test_sh4eb_r2d.py            |   7 +-
 tests/functional/test_sparc64_sun4u.py        |   3 +-
 tests/functional/test_sparc64_tuxrun.py       |   1 +
 tests/functional/test_sparc_sun4m.py          |   2 +-
 tests/functional/test_virtio_balloon.py       |  10 +-
 tests/functional/test_virtio_gpu.py           |  14 +-
 tests/functional/test_virtio_version.py       |   1 +
 tests/functional/test_x86_64_hotplug_blk.py   |   6 +-
 tests/functional/test_x86_64_hotplug_cpu.py   |   6 +-
 tests/functional/test_x86_64_kvm_xen.py       |   8 +-
 tests/functional/test_x86_64_replay.py        |   4 +-
 tests/functional/test_x86_64_reverse_debug.py |   2 +-
 tests/functional/test_x86_64_tuxrun.py        |   1 +
 .../functional/test_x86_cpu_model_versions.py |  13 +-
 tests/functional/test_xtensa_lx60.py          |   2 +-
 tests/guest-debug/run-test.py                 |   9 +-
 tests/guest-debug/test_gdbstub.py             |  15 +-
 tests/image-fuzzer/qcow2/fuzz.py              |   3 +-
 tests/image-fuzzer/qcow2/layout.py            |  32 ++-
 tests/image-fuzzer/runner.py                  |  19 +-
 tests/lcitool/refresh                         |   6 +-
 tests/migration-stress/guestperf-batch.py     |   1 +
 tests/migration-stress/guestperf-plot.py      |   1 +
 tests/migration-stress/guestperf.py           |   1 +
 .../migration-stress/guestperf/comparison.py  |   3 +-
 tests/migration-stress/guestperf/engine.py    |   8 +-
 tests/migration-stress/guestperf/hardware.py  |   2 +-
 tests/migration-stress/guestperf/plot.py      |   4 +-
 tests/migration-stress/guestperf/progress.py  |   4 +-
 tests/migration-stress/guestperf/report.py    |   9 +-
 tests/migration-stress/guestperf/scenario.py  |   2 +-
 tests/migration-stress/guestperf/shell.py     |  18 +-
 tests/migration-stress/guestperf/timings.py   |   4 +-
 tests/qapi-schema/test-qapi.py                |   2 +-
 tests/qemu-iotests/030                        |   6 +-
 tests/qemu-iotests/040                        |   6 +-
 tests/qemu-iotests/041                        |   7 +-
 tests/qemu-iotests/044                        |  11 +-
 tests/qemu-iotests/045                        |  10 +-
 tests/qemu-iotests/055                        |   4 +-
 tests/qemu-iotests/056                        |   6 +-
 tests/qemu-iotests/057                        |   5 +-
 tests/qemu-iotests/065                        |  10 +-
 tests/qemu-iotests/093                        |   9 +-
 tests/qemu-iotests/096                        |   4 +-
 tests/qemu-iotests/118                        |   4 +-
 tests/qemu-iotests/124                        |   8 +-
 tests/qemu-iotests/129                        |   2 +
 tests/qemu-iotests/132                        |   3 +-
 tests/qemu-iotests/136                        |   4 +-
 tests/qemu-iotests/139                        |   3 +-
 tests/qemu-iotests/141                        |   1 +
 tests/qemu-iotests/147                        |  13 +-
 tests/qemu-iotests/148                        |   2 +
 tests/qemu-iotests/149                        |   7 +-
 tests/qemu-iotests/151                        |   6 +-
 tests/qemu-iotests/152                        |   2 +
 tests/qemu-iotests/155                        |   2 +
 tests/qemu-iotests/163                        |  11 +-
 tests/qemu-iotests/165                        |   3 +-
 tests/qemu-iotests/194                        |   7 +-
 tests/qemu-iotests/196                        |   2 +
 tests/qemu-iotests/202                        |   1 +
 tests/qemu-iotests/203                        |   1 +
 tests/qemu-iotests/205                        |  11 +-
 tests/qemu-iotests/206                        |   1 +
 tests/qemu-iotests/207                        |   6 +-
 tests/qemu-iotests/208                        |   1 +
 tests/qemu-iotests/209                        |  11 +-
 tests/qemu-iotests/210                        |   1 +
 tests/qemu-iotests/211                        |   1 +
 tests/qemu-iotests/212                        |   1 +
 tests/qemu-iotests/213                        |   1 +
 tests/qemu-iotests/216                        |   1 +
 tests/qemu-iotests/218                        |   1 +
 tests/qemu-iotests/219                        |   1 +
 tests/qemu-iotests/224                        |  13 +-
 tests/qemu-iotests/228                        |  11 +-
 tests/qemu-iotests/234                        |   4 +-
 tests/qemu-iotests/235                        |  14 +-
 tests/qemu-iotests/236                        |   1 +
 tests/qemu-iotests/237                        |   2 +
 tests/qemu-iotests/238                        |   3 +-
 tests/qemu-iotests/240                        |   2 +-
 tests/qemu-iotests/242                        |  23 +-
 tests/qemu-iotests/245                        |   1 +
 tests/qemu-iotests/246                        |   1 +
 tests/qemu-iotests/248                        |  12 +-
 tests/qemu-iotests/254                        |   3 +-
 tests/qemu-iotests/255                        |   1 +
 tests/qemu-iotests/256                        |   4 +-
 tests/qemu-iotests/257                        |  28 +-
 tests/qemu-iotests/258                        |  10 +-
 tests/qemu-iotests/260                        |   8 +-
 tests/qemu-iotests/262                        |   4 +-
 tests/qemu-iotests/264                        |   7 +-
 tests/qemu-iotests/274                        |   1 +
 tests/qemu-iotests/277                        |  10 +-
 tests/qemu-iotests/280                        |   2 +-
 tests/qemu-iotests/281                        |   4 +-
 tests/qemu-iotests/283                        |   1 +
 tests/qemu-iotests/295                        |   6 +-
 tests/qemu-iotests/296                        |   7 +-
 tests/qemu-iotests/297                        |   8 +-
 tests/qemu-iotests/298                        |   2 +
 tests/qemu-iotests/299                        |   1 +
 tests/qemu-iotests/300                        |  10 +-
 tests/qemu-iotests/302                        |   4 +-
 tests/qemu-iotests/303                        |  13 +-
 tests/qemu-iotests/304                        |   3 +-
 tests/qemu-iotests/307                        |   2 +-
 tests/qemu-iotests/310                        |   1 +
 tests/qemu-iotests/check                      |   7 +-
 tests/qemu-iotests/fat16.py                   |  12 +-
 tests/qemu-iotests/findtests.py               |  19 +-
 tests/qemu-iotests/iotests.py                 |  70 +++--
 tests/qemu-iotests/linters.py                 |   9 +-
 tests/qemu-iotests/nbd-fault-injector.py      |  13 +-
 tests/qemu-iotests/qcow2.py                   |   5 +-
 tests/qemu-iotests/qcow2_format.py            |  14 +-
 tests/qemu-iotests/qed.py                     |  10 +-
 tests/qemu-iotests/testenv.py                 |  25 +-
 tests/qemu-iotests/testrunner.py              |  32 +--
 tests/qemu-iotests/tests/block-status-cache   |   1 +
 .../tests/export-incoming-iothread            |   1 +
 .../qemu-iotests/tests/graph-changes-while-io |  11 +-
 tests/qemu-iotests/tests/image-fleecing       |   1 +
 tests/qemu-iotests/tests/inactive-node-nbd    |   8 +-
 .../tests/iothreads-commit-active             |   2 +
 tests/qemu-iotests/tests/iothreads-create     |   2 +
 tests/qemu-iotests/tests/iothreads-nbd-export |   3 +
 tests/qemu-iotests/tests/iothreads-stream     |   2 +
 tests/qemu-iotests/tests/luks-detached-header |   5 +-
 .../tests/migrate-bitmaps-postcopy-test       |  10 +-
 tests/qemu-iotests/tests/migrate-bitmaps-test |   2 +-
 .../qemu-iotests/tests/migrate-during-backup  |   1 +
 .../tests/mirror-change-copy-mode             |   3 +-
 .../tests/mirror-ready-cancel-error           |   1 +
 tests/qemu-iotests/tests/nbd-multiconn        |   2 +-
 .../qemu-iotests/tests/nbd-reconnect-on-open  |  11 +-
 .../qemu-iotests/tests/parallels-read-bitmap  |   8 +-
 tests/qemu-iotests/tests/qsd-migrate          |   2 +-
 .../tests/remove-bitmap-from-backing          |   8 +-
 tests/qemu-iotests/tests/reopen-file          |   3 +-
 .../qemu-iotests/tests/stream-error-on-reset  |   8 +-
 .../tests/stream-unaligned-prefetch           |  13 +-
 .../qemu-iotests/tests/stream-under-throttle  |   4 +-
 tests/qemu-iotests/tests/vvfat                |   7 +-
 tests/tcg/aarch64/gdbstub/test-mte.py         |   2 +-
 tests/tcg/aarch64/gdbstub/test-sve-ioctl.py   |   4 +-
 tests/tcg/aarch64/gdbstub/test-sve.py         |   2 +-
 tests/tcg/i386/test-avx.py                    |  11 +-
 tests/tcg/i386/test-mmx.py                    |   9 +-
 tests/tcg/multiarch/gdbstub/catch-syscalls.py |   6 +-
 .../gdbstub/follow-fork-mode-child.py         |   4 +-
 .../gdbstub/follow-fork-mode-parent.py        |   2 +-
 tests/tcg/multiarch/gdbstub/interrupt.py      |   1 -
 tests/tcg/multiarch/gdbstub/late-attach.py    |   4 +-
 tests/tcg/multiarch/gdbstub/memory.py         |   2 -
 tests/tcg/multiarch/gdbstub/prot-none.py      |   5 +-
 tests/tcg/multiarch/gdbstub/registers.py      |   3 +-
 tests/tcg/multiarch/gdbstub/sha1.py           |   1 -
 .../multiarch/gdbstub/test-proc-mappings.py   |   1 -
 .../multiarch/gdbstub/test-qxfer-auxv-read.py |   1 -
 .../gdbstub/test-qxfer-siginfo-read.py        |   2 +-
 .../gdbstub/test-thread-breakpoint.py         |   1 -
 .../system/validate-memory-counts.py          |   7 +-
 tests/tcg/s390x/gdbstub/test-signals-s390x.py |   2 -
 tests/tcg/s390x/gdbstub/test-svc.py           |   1 -
 tests/vm/aarch64vm.py                         |  16 +-
 tests/vm/basevm.py                            |  37 +--
 tests/vm/centos.aarch64                       |  11 +-
 tests/vm/freebsd                              |   7 +-
 tests/vm/haiku.x86_64                         |   7 +-
 tests/vm/netbsd                               |   5 +-
 tests/vm/openbsd                              |   5 +-
 tests/vm/ubuntu.aarch64                       |   6 +-
 tests/vm/ubuntuvm.py                          |   6 +-
 456 files changed, 2624 insertions(+), 2058 deletions(-)
 create mode 100644 python/pyproject.toml
 delete mode 100755 python/setup.py

-- 
2.48.1

Re: [PATCH v2 00/12] Python: Fix 'make check-dev' and modernize to 3.9+
Posted by Akihiko Odaki 5 months ago
On 2025/06/13 5:54, John Snow wrote:
> This series does a couple things that I'll probably end up splitting out
> into smaller series if history is any guide, but either way, here it
> goes:

I'm surprised with the large number of Ccs. I suggest splitting the 
series with subsystem boundaries to reduce the number of Ccs for each 
split series.

> 
> A) Convert qemu.git/python/ to a PEP517/pyproject.toml
> package. Ultimately this means deleting setup.py and fully migrating to
> newer python infrastructure. I think this should be safe to do by now,
> but admittedly I am not *confident* as it relies on setuptools versions
> in the wild, not python versions. My motivation for trying it is to fix
> "make check-dev", which has been broken for the last two Fedora releases
> under newer setuptools which have started removing support for the
> pre-PEP517 packaging formats, which will only continue to get worse from
> here on out.

I'm afraid this change may not be safe.

The documentation of setuptools says pyproject.toml is supported since 
61.0.0:
https://setuptools.pypa.io/en/stable/userguide/pyproject_config.html

Looking at Repology as suggested in docs/about/build-platforms.rst, the 
following distributions have older setuptools, unfortunately:
CentOS Stream 9: 53.0.0
Debian 11: 44.1.1
Ubuntu 22.04: 44.1.1

docs/about/build-platforms.rst also says:
 > Optional build dependencies
 >   Build components whose absence does not affect the ability to build
 >   QEMU may not be available in distros, or may be too old for our
 >   requirements. Many of these, such as additional modules for the
 >   functional testing framework or various linters, are written in
 >   Python and therefore can also be installed using ``pip``.

In my understanding, QEMU Python Tooling is an optional component so 
dropping the support of old Linux distribution is tolerated according to 
the documentation. But I think we still need to assess the potential 
impact on the usability to justify that.

A possible option is to fetch a new version of setuptools version when 
necessary. The same documentation says:
 > Python build dependencies
 >   Some of QEMU's build dependencies are written in Python.  Usually
 >   these are only packaged by distributions for the default Python
 >   runtime.
 >   If QEMU bumps its minimum Python version and a non-default runtime
 >   is required, it may be necessary to fetch python modules from the
 >   Python Package Index (PyPI) via ``pip``, in order to build QEMU.

Automatically fetching a compatible version of setuptools as described 
here will reduce the adverse effect of the change.

The documentation page of setuptools I mentioned earlier has the 
following note:
 > If compatibility with legacy builds or versions of tools that don’t
 > support certain packaging standards (e.g. PEP 517 or PEP 660), a
 > simple setup.py script can be added to your project [1] (while keeping
 > the configuration in pyproject.toml):
 >
 > from setuptools import setup
 >
 > setup()

I have no idea what it means though. (Will it automatically fetch new 
setuptools to parse pyproject.toml or something?)

> C) Move us to 3.9+ style type hints. They are deprecated in 3.9, and
> *could* be removed at any time. I figured now was a good time as any to
> get rid of them before they become a problem randomly some day in the
> future.

I guess you meant that the old style type hints are deprecated.

Regards,
Akihiko Odaki