Commit 1aa22ffee2 for qemu.org

commit 1aa22ffee205f9b3be1c43bd2d5dea05ab2ddcff
Author: John Snow <jsnow@redhat.com>
Date:   Wed Feb 18 16:34:01 2026 -0500

    meson, mkvenv: add functests custom target

    add the "pyvenv_functests_group" target to meson. This target will
    invoke mkvenv.py to install the associated dependency group to the
    build/pyvenv directory.

    A "pyvenv_tooling_group" is not included here as it is the plan to
    always install this group by default, so it will not need an on-demand
    trigger.

    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Message-ID: <20260218213416.674483-7-jsnow@redhat.com>
    Signed-off-by: John Snow <jsnow@redhat.com>

diff --git a/meson.build b/meson.build
index 414c8ea7e2..59c8204d88 100644
--- a/meson.build
+++ b/meson.build
@@ -4580,6 +4580,7 @@ subdir('scripts')
 subdir('tools')
 subdir('pc-bios')
 subdir('docs')
+subdir('pyvenv')
 # Tests are disabled on emscripten because they rely on host features that aren't
 # supported by emscripten (e.g. fork and unix socket).
 if host_os != 'emscripten'
diff --git a/pyvenv/meson.build b/pyvenv/meson.build
new file mode 100644
index 0000000000..4e7d8d9fcc
--- /dev/null
+++ b/pyvenv/meson.build
@@ -0,0 +1,27 @@
+# Note that this file only controls "optional" dependency groups; groups
+# unconditionally installed at configure time are handled in configure
+# instead; namely: meson, sphinx, and the tooling groups.
+
+# Note that this command may or may not include the "--online" flag
+# based on configuration.
+ensuregroup_cmd = config_host['MKVENV_ENSUREGROUP'].split()
+
+pyvenv_common_deps = files(
+    meson.project_source_root() + '/pythondeps.toml',
+    meson.project_source_root() + '/python/scripts/mkvenv.py'
+)
+pyvenv_wheel_dir = meson.project_source_root() + '/python/wheels'
+
+# This group is allowed to (and must) rely on internet to fetch from
+# PyPI. Force the use of the --online flag here.
+pyvenv_functests_group = custom_target(
+    'pyvenv_functests_group',
+    output: 'functests.group',
+    input: pyvenv_common_deps,
+    command: ensuregroup_cmd + [
+        '--online',
+        '--dir', pyvenv_wheel_dir,
+        '@INPUT0@',
+        'functests',
+    ],
+)