Package: python3-pytestqt
Version: 4.4.0-2
Severity: serious
Justification: Breaks rdeps (build and autopkgtests)
X-Debbugs-Cc: [email protected]

Dear Maintainer,

In solving #1124166, python3-pytestqt grew a dependency on
"python3-pyside6.qttest | python3-pyside2.qttest". Unfortunately, that
switches the default Python-Qt implementation that pytestqt uses from
PyQt6 to PySide6. This has caused regressions in autopkgtests for a few
packages, as noted in the debci dashboard.

One specific example I noticed was refnx:

Following this change to pytest-qt:

 autopkgtest [17:12:48]: test python3-refnx: [-----------------------
 73s ============================= test session starts 
==============================
 73s platform linux -- Python 3.13.11, pytest-9.0.2, pluggy-1.6.0 -- 
/usr/bin/python3
 73s cachedir: .pytest_cache
 73s PySide6 6.9.2 -- Qt runtime 6.9.2 -- Qt compiled 6.9.2

(fails)

But previously:

 73s autopkgtest [03:31:16]: test python3-refnx: [-----------------------
 74s ============================= test session starts 
==============================
 74s platform linux -- Python 3.13.11, pytest-9.0.2, pluggy-1.6.0 -- 
/usr/bin/python3
 74s cachedir: .pytest_cache
 74s PyQt6 6.10.2 -- Qt runtime 6.9.2 -- Qt compiled 6.9.2

(passes)

Upstream documentation indicates that autodetection of the Qt API is
supported, with pytest-qt simply trying to import PySide6, PyQt6, PyQt5
in that order and then using which one works first. Unfortunately, these
dependencies mean that is no longer true.

Perhaps refnx's debian/tests/control, debian/tests/python3-refnx and/or
pyproject.toml need to be more specific about the Qt API to use... but
switching the default behaviour to "always use PySide6" doesn't seem
like a desired outcome either.

For inkcut, ths solution is to ensure that the tests are run against
pyqt5, since the build chroot somehow has both pyqt5 and pyside6 installed
in it, with the latter taking precedence in the pytest-qt detection. I
think pyside6 is coming in via python3-pyqtgraph which has picked up
some explicit and non-optional pyside6 dependencies alongside its
normal set of optional dependencies. (This is probably also a bug.)

>From the PySide6 packaging perspective, users of pyside6 packages should
explicitly depend on the bits that they need, meaning that pytest-qt
should not need to deal with that; if you wanted to offer API-specific
packages (like python3-pytestqt-pyside6, see also python3-qtpy-*
packages) to bring in extra dependencies that would work too.

thanks
Stuart

Reply via email to