[Pkg-libvirt-commits] [Git][libvirt-team/virt-manager][debian/sid] 4 commits: d/patches: backport changes for compatibility with pytest 9

Pino Toscano (@pino) gitlab at salsa.debian.org
Fri Aug 7 05:56:20 BST 2026



Pino Toscano pushed to branch debian/sid at Libvirt Packaging Team / virt-manager


Commits:
fe950f33 by Pino Toscano at 2026-08-07T06:49:09+02:00
d/patches: backport changes for compatibility with pytest 9

Closes: #1141028

- - - - -
d30fb4db by Pino Toscano at 2026-08-07T05:50:13+01:00
Remove redundant Priority: optional from source stanza.

Changes-By: lintian-brush
Fixes: lintian: source: redundant-priority-optional-field
See-also: https://lintian.debian.org/tags/redundant-priority-optional-field.html

- - - - -
e73c0544 by Pino Toscano at 2026-08-07T05:50:20+01:00
Update standards version to 4.7.4, no changes needed.

Upgrade checklist verified:
 4.7.3 → 4.7.4:
  * Package is not in non-free-firmware

Changes-By: lintian-brush
Fixes: lintian: source: out-of-date-standards-version 4.7.2 (released 2025-02-27) (current is 4.7.4.1)
See-also: https://lintian.debian.org/tags/out-of-date-standards-version.html

- - - - -
ffb6df6a by Pino Toscano at 2026-08-07T06:52:41+02:00
d/watch: switch to v5

- - - - -


6 changed files:

- debian/control
- debian/patches/series
- + debian/patches/upstream_tests-handle-collection_path-and-path-for-pytest_ign.patch
- + debian/patches/upstream_tests-port-pytest_ignore_collect-to-pathlib.patch
- + debian/patches/upstream_tests-use-Node.path-when-available.patch
- debian/watch


Changes:

=====================================
debian/control
=====================================
@@ -1,11 +1,10 @@
 Source: virt-manager
 Section: admin
-Priority: optional
 Maintainer: Debian Libvirt Maintainers <pkg-libvirt-maintainers at lists.alioth.debian.org>
 Uploaders:
  Guido Günther <agx at sigxcpu.org>,
  Pino Toscano <pino at debian.org>,
-Standards-Version: 4.7.2
+Standards-Version: 4.7.4
 Vcs-Git: https://salsa.debian.org/libvirt-team/virt-manager.git
 Vcs-Browser: https://salsa.debian.org/libvirt-team/virt-manager
 Homepage: https://virt-manager.org/


=====================================
debian/patches/series
=====================================
@@ -1 +1,4 @@
+upstream_tests-port-pytest_ignore_collect-to-pathlib.patch
+upstream_tests-handle-collection_path-and-path-for-pytest_ign.patch
+upstream_tests-use-Node.path-when-available.patch
 tests-fix-vcpu.diff


=====================================
debian/patches/upstream_tests-handle-collection_path-and-path-for-pytest_ign.patch
=====================================
@@ -0,0 +1,68 @@
+From 711275b92971647a087ef6e263d9125ced689e38 Mon Sep 17 00:00:00 2001
+From: Pino Toscano <ptoscano at redhat.com>
+Date: Mon, 30 Jun 2025 14:20:36 +0200
+Subject: [PATCH] tests: handle "collection_path" and "path" for
+ pytest_ignore_collect()
+
+Starting from pytest 7, all the hooks that take a "path" (the legacy
+path data type) as parameter (including pytest_ignore_collect()) now
+take a "collection_path" (pathlib.Path), and the latter will be the
+only option starting from pytest 9.
+
+Since it looks like pluggy (the plugin/hook infrastructure used by
+pytest underneath) does not support using "None" to accept extra
+arguments in an hook, then the solution is to provide different hooks
+according to the pytest version:
+- the common implementation is switched to use pathlib.Path, looking
+  like the new style of hook; once pytest 7 is assumed, this helper
+  function can be switched back to be the actual hook
+- declare pytest_ignore_collect() as supported by pytest, using
+  "collection_path" as earlier as possible; pytest_ignore_collect()
+  is either a no-op wrapper, or builds a pathlib.Path out of the legacy
+  type
+- pytest.version_tuple was added in pytest 7, so deal with its lack in
+  older versions
+
+All in all, there should be no behaviour change in the actual test
+collection, and the deprecation warnings should be gone.
+
+Signed-off-by: Pino Toscano <ptoscano at redhat.com>
+---
+ tests/conftest.py | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/tests/conftest.py b/tests/conftest.py
+index 38cb09f1f..3c0731138 100644
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -53,8 +53,7 @@ def pytest_addoption(parser):
+     )
+ 
+ 
+-def pytest_ignore_collect(path, config):
+-    collection_path = pathlib.Path(path)
++def _impl_pytest_ignore_collect(collection_path, config):
+     uitests_requested = config.getoption("--uitests")
+ 
+     # Default --uitests to --verbosity=2
+@@ -76,6 +75,17 @@ def pytest_ignore_collect(path, config):
+         return True
+ 
+ 
++if getattr(pytest, "version_tuple", (0,)) >= (7,):
++
++    def pytest_ignore_collect(collection_path, config):
++        return _impl_pytest_ignore_collect(collection_path, config)
++
++else:
++
++    def pytest_ignore_collect(path, config):
++        return _impl_pytest_ignore_collect(pathlib.Path(path), config)
++
++
+ def pytest_collection_modifyitems(config, items):
+     def find_items(basename):
+         return [i for i in items if os.path.basename(i.fspath) == basename]
+-- 
+2.53.0
+


=====================================
debian/patches/upstream_tests-port-pytest_ignore_collect-to-pathlib.patch
=====================================
@@ -0,0 +1,61 @@
+From a5a54036919aa4bc6e7a7918865cabc58a9c70d9 Mon Sep 17 00:00:00 2001
+From: Pino Toscano <ptoscano at redhat.com>
+Date: Mon, 30 Jun 2025 14:10:16 +0200
+Subject: [PATCH] tests: port pytest_ignore_collect() to pathlib
+
+Create a pathlib version of the "path" argument of the
+pytest_ignore_collect() hook; this will make it easier to the newer
+version that uses pathlib directly.
+
+This makes it possible to simplify the check for filenames to ignore:
+since the filename is available, use it to do a quick lookup.
+
+Signed-off-by: Pino Toscano <ptoscano at redhat.com>
+---
+ tests/conftest.py | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/tests/conftest.py b/tests/conftest.py
+index 7ec7adf10..38cb09f1f 100644
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -2,6 +2,7 @@
+ # See the COPYING file in the top-level directory.
+ 
+ import os
++import pathlib
+ 
+ import pytest
+ 
+@@ -53,6 +54,7 @@ def pytest_addoption(parser):
+ 
+ 
+ def pytest_ignore_collect(path, config):
++    collection_path = pathlib.Path(path)
+     uitests_requested = config.getoption("--uitests")
+ 
+     # Default --uitests to --verbosity=2
+@@ -60,14 +62,14 @@ def pytest_ignore_collect(path, config):
+         config.option.verbose = max(2, config.option.verbose)
+ 
+     # Unless explicitly requested, ignore these tests
+-    if "test_dist.py" in str(path):
+-        return True
+-    if "test_urls.py" in str(path):
+-        return True
+-    if "test_inject.py" in str(path):
++    if collection_path.name in (
++        "test_dist.py",
++        "test_urls.py",
++        "test_inject.py",
++    ):
+         return True
+ 
+-    uitest_file = "tests/uitests" in str(path)
++    uitest_file = "tests/uitests" in str(collection_path)
+     if uitest_file and not uitests_requested:
+         return True
+     if not uitest_file and uitests_requested:
+-- 
+2.53.0
+


=====================================
debian/patches/upstream_tests-use-Node.path-when-available.patch
=====================================
@@ -0,0 +1,39 @@
+From 206e79d501a8a2226595e766418ff4253d8b6ff0 Mon Sep 17 00:00:00 2001
+From: Pino Toscano <ptoscano at redhat.com>
+Date: Mon, 30 Jun 2025 14:56:08 +0200
+Subject: [PATCH] tests: use Node.path when available
+
+pytest 7 adds a "path" attribute to the Node class, which is the base of
+the Item class used for items passed to pytest_collection_modifyitems().
+
+Hence use it when available, using an helper function that tries to use
+it and fallbacks on the old "fspath".
+
+Signed-off-by: Pino Toscano <ptoscano at redhat.com>
+---
+ tests/conftest.py | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/tests/conftest.py b/tests/conftest.py
+index 3c0731138..88a710fdd 100644
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -87,8 +87,14 @@ else:
+ 
+ 
+ def pytest_collection_modifyitems(config, items):
++    def item_path_basename(item):
++        try:
++            return item.path.name
++        except AttributeError:
++            return os.path.basename(item.fspath)
++
+     def find_items(basename):
+-        return [i for i in items if os.path.basename(i.fspath) == basename]
++        return [i for i in items if item_path_basename(i) == basename]
+ 
+     # Move test_cli cases to the end, because they are slow
+     # Move test_checkprops to the very end, because it needs to run
+-- 
+2.53.0
+


=====================================
debian/watch
=====================================
@@ -1,3 +1,5 @@
-version=4
+Version: 5
 
-opts=pgpsigurlmangle=s/$/.asc/ https://releases.pagure.org/virt-manager/virt-manager-(.*)\.tar\.(?:gz|xz)
+Source: https://releases.pagure.org/virt-manager/
+Matching-Pattern: virt-manager-(.*)\.tar\.(?:gz|xz)
+Pgp-Mode: auto



View it on GitLab: https://salsa.debian.org/libvirt-team/virt-manager/-/compare/00c0ce2aae6da30c1f9489ebf5bdf72dff45d687...ffb6df6a1917e3f1953746f7e4be3230b0d4f2c7

-- 
View it on GitLab: https://salsa.debian.org/libvirt-team/virt-manager/-/compare/00c0ce2aae6da30c1f9489ebf5bdf72dff45d687...ffb6df6a1917e3f1953746f7e4be3230b0d4f2c7
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-libvirt-commits/attachments/20260807/6f5ba84a/attachment-0001.htm>


More information about the Pkg-libvirt-commits mailing list