Even though we have been pinning versions for the minreqs test, the
conflict arises because the isolated build environment that some
versions of pip use by default will pull in the latest and greatest
version.

Switch to using a non-isolated build mode and pin more of the packaging
ecosystem to keep our Python 3.9 tests running happy on modern machines.

Note that we will be able to require Python >= 3.11 at the end of April
when we drop support for Ubuntu 22.04 LTS.

Signed-off-by: John Snow <[email protected]>
---
 python/Makefile          |  5 ++---
 python/tests/minreqs.txt | 10 +++++-----
 tests/Makefile.include   |  2 +-
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/python/Makefile b/python/Makefile
index 32aedce4137..c143eaa10e7 100644
--- a/python/Makefile
+++ b/python/Makefile
@@ -63,12 +63,11 @@ $(QEMU_MINVENV_DIR) $(QEMU_MINVENV_DIR)/bin/activate: 
setup.cfg tests/minreqs.tx
        @(                                                              \
                echo "ACTIVATE $(QEMU_MINVENV_DIR)";                    \
                . $(QEMU_MINVENV_DIR)/bin/activate;                     \
-               echo "INSTALL wheel $(QEMU_MINVENV_DIR)";               \
-               $(PIP_INSTALL) wheel 1>/dev/null;                              \
                echo "INSTALL -r tests/minreqs.txt $(QEMU_MINVENV_DIR)";\
                $(PIP_INSTALL) -r tests/minreqs.txt 1>/dev/null;        \
                echo "INSTALL -e qemu $(QEMU_MINVENV_DIR)";             \
-               PIP_CONFIG_SETTINGS="editable_mode=compat" $(PIP_INSTALL) -e . 
1>/dev/null;     \
+               PIP_CONFIG_SETTINGS="editable_mode=compat"              \
+               $(PIP_INSTALL) --no-build-isolation -e . 1>/dev/null;   \
        )
        @touch $(QEMU_MINVENV_DIR)
 
diff --git a/python/tests/minreqs.txt b/python/tests/minreqs.txt
index cd2e2a81c3d..c5ae63567e8 100644
--- a/python/tests/minreqs.txt
+++ b/python/tests/minreqs.txt
@@ -11,11 +11,12 @@
 # When adding new dependencies, pin the very oldest non-yanked version
 # on PyPI that allows the test suite to pass.
 
-# For some reason, the presence of packaging==14.0 below requires us to
-# also pin setuptools to version 70 or below. Otherwise, the
-# installation of the QEMU package itself fails, failing to find
-# setuptools.
+# Pin packaging utilities to older versions to prevent difficulties
+# mixing and matching newer and older ecosystem packages.
+packaging==14.0
 setuptools<=70
+wheel<0.46
+pip<26
 
 # Dependencies for qapidoc/qapi_domain et al
 sphinx==3.4.3
@@ -66,7 +67,6 @@ alabaster==0.7.1
 babel==1.3
 docutils==0.12
 imagesize==0.5.0
-packaging==14.0
 pytz==2011b0
 requests==2.5.0
 snowballstemmer==1.1
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 7728098981d..09ceaee675f 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -106,7 +106,7 @@ quiet-venv-pip = $(quiet-@)$(call quiet-command-run, \
     "VENVPIP","$1")
 
 $(TESTS_VENV_TOKEN): $(SRC_PATH)/pythondeps.toml
-       $(call quiet-venv-pip,install -e "$(SRC_PATH)/python/")
+       $(call quiet-venv-pip,install --no-build-isolation -e 
"$(SRC_PATH)/python/")
        $(MKVENV_ENSUREGROUP) $< testdeps
        $(call quiet-command, touch $@)
 
-- 
2.53.0


Reply via email to