From c03f57fd5bf72588a05750f14202f63be7ddbd0c Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 8 Aug 2023 11:28:08 +0200 Subject: Revert "tests: Use separate virtual environment for avocado" This reverts commit e8e4298feadae7924cf7600bb3bcc5b0a8d7cbe9. ensuregroup allows to specify both the acceptable versions of avocado, and a locked version to be used when avocado is not installed as a system pacakge. This lets us install avocado in pyvenv/ using "mkvenv.py" and reuse the distro package on Fedora and CentOS Stream (the only distros where it's available). ensuregroup's usage of "(>=..., <=...)" constraints when evaluating the distro package, and "==" constraints when installing it from PyPI, makes it possible to avoid conflicts between the known-good version and a package plugins included in the distro. This is because package plugins have "==" constraints on the version that is included in the distro, and, using "pip install avocado==88.1" on a venv that includes system packages will result in an error: avocado-framework-plugin-varianter-yaml-to-mux 98.0 requires avocado-framework==98.0, but you have avocado-framework 88.1 which is incompatible. avocado-framework-plugin-result-html 98.0 requires avocado-framework==98.0, but you have avocado-framework 88.1 which is incompatible. But at the same time, if the venv does not include a system distribution of avocado then we can install a known-good version and stick to LTS releases. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1663 Signed-off-by: Paolo Bonzini --- python/scripts/mkvenv.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'python/scripts/mkvenv.py') diff --git a/python/scripts/mkvenv.py b/python/scripts/mkvenv.py index 02bcd9a8c9..4f2349fbb6 100644 --- a/python/scripts/mkvenv.py +++ b/python/scripts/mkvenv.py @@ -964,14 +964,11 @@ def _parse_groups(file: str) -> Dict[str, Dict[str, Any]]: "Python >=3.11 does not have tomllib... what have you done!?" ) - try: - # Use loads() to support both tomli v1.2.x (Ubuntu 22.04, - # Debian bullseye-backports) and v2.0.x - with open(file, "r", encoding="ascii") as depfile: - contents = depfile.read() - return tomllib.loads(contents) # type: ignore - except tomllib.TOMLDecodeError as exc: - raise Ouch(f"parsing {file} failed: {exc}") from exc + # Use loads() to support both tomli v1.2.x (Ubuntu 22.04, + # Debian bullseye-backports) and v2.0.x + with open(file, "r", encoding="ascii") as depfile: + contents = depfile.read() + return tomllib.loads(contents) # type: ignore def ensure_group( -- cgit v1.2.3