#1148059 python-qemu-qmp: FTBFS with urwid 4.x

#1148059#5
Date:
2026-09-16 14:20:50 UTC
From:
To:
Dear Debian python-qemu-qmp maintainer,

Your package, python-qemu-qmp, fails to build from source with urwid/4.1.3-1
in Debian Unstable. Its autopkgtest would also fail.

There is no functionality regression; the issue comes from the linter tests:

|
FAILED tests/linters.py::TestLinters::test_mypy
FAILED tests/linters.py::TestLinters::test_pylint

|
There are independent causes, both in qemu/qmp/qmp_tui.py (which the
Debian package does not even ship as a command, since debian/rules
removes usr/bin/qmp-tui):
1. urwid 4.1 started shipping a py.typed marker. mypy therefore
stops treating urwid as an untyped library, the existing
"ignore_missing_imports = True" for urwid has no effect any more,
and qmp_tui.py fails with nine errors such as:
qmp_tui.py:538: error: Argument 1 of "mouse_event" is incompatible
with supertype "urwid.widget.widget.Widget" [override]
qmp_tui.py:498: error: Missing type arguments for generic type
"Filler" [type-arg]
qmp_tui.py:400: error: Argument "unhandled_input" to "MainLoop" has
incompatible type "Callable[[str], None]" [arg-type]
2. urwid 4 deepened its widget class hierarchy, so pylint now reports
R0901 too-many-ancestors (8-10 of 7) for the four widget subclasses
in qmp_tui.py.|

The attached patch keeps both linters passing by making mypy treat urwid as untyped again ("follow_imports = skip" for
urwid and urwid.*) and by disabling too-many-ancestors, since the ancestor count comes from urwid rather than from this
code base. With the patch applied, a build in a clean sid chroot (python3-urwid 4.1.3-1, python3-mypy 2.2.0-5, pylint
4.0.8-1) succeeds and the autopkgtest passes with 31 tests. The change is backwards compatible with urwid 3.x and could
be forwarded upstream as is. If you do not have time for this, I am happy to do an NMU with the attached patch with
DELAYED/5. Let me know if you find that necessary. Thanks, Boyuan Yang|

#1148059#14
Date:
2026-09-17 19:36:15 UTC
From:
To:
Dear maintainer,

I've prepared an NMU for python-qemu-qmp (versioned as 0.0.6-1.1) and
uploaded it to DELAYED/14. Please feel free to tell me if I
should cancel it.

Regards.

diffstat for python-qemu-qmp-0.0.6 python-qemu-qmp-0.0.6

  changelog                                                   |  10 ++
  patches/0001-Keep-linter-tests-passing-with-urwid-4.x.patch |  43 ++++++++++++
  patches/series                                              | 1
  3 files changed, 54 insertions(+)

diff -Nru python-qemu-qmp-0.0.6/debian/changelog python-qemu-qmp-0.0.6/debian/changelog
--- python-qemu-qmp-0.0.6/debian/changelog    2026-04-03 13:05:58.000000000 -0400
+++ python-qemu-qmp-0.0.6/debian/changelog    2026-09-17 15:27:43.000000000 -0400
@@ -1,3 +1,13 @@
+python-qemu-qmp (0.0.6-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * debian/patches/0001-Keep-linter-tests-passing-with-urwid-4.x.patch:
+    Add patch to fix FTBFS and autopkgtest failure with urwid 4.x: make
+    mypy keep treating urwid as untyped and disable the pylint
+    too-many-ancestors check. (Closes: #1148059)
+
+ -- Boyuan Yang <byang@debian.org>  Thu, 17 Sep 2026 15:27:43 -0400
+
  python-qemu-qmp (0.0.6-1) unstable; urgency=medium

    * new upstream release 0.0.6
diff -Nru python-qemu-qmp-0.0.6/debian/patches/0001-Keep-linter-tests-passing-with-urwid-4.x.patch
python-qemu-qmp-0.0.6/debian/patches/0001-Keep-linter-tests-passing-with-urwid-4.x.patch
--- python-qemu-qmp-0.0.6/debian/patches/0001-Keep-linter-tests-passing-with-urwid-4.x.patch   1969-12-31 
19:00:00.000000000 -0500
+++ python-qemu-qmp-0.0.6/debian/patches/0001-Keep-linter-tests-passing-with-urwid-4.x.patch   2026-09-17
15:27:38.000000000 -0400
@@ -0,0 +1,43 @@
+From: Boyuan Yang <byang@debian.org>
+Date: Wed, 16 Sep 2026 10:20:50 -0400
+Subject: Keep linter tests passing with urwid 4.x
+
+urwid >= 4.1 ships a py.typed marker, so mypy no longer treats it as an
+untyped library and "ignore_missing_imports" has no effect any more;
+qmp_tui.py, which predates those annotations, then fails test_mypy with
+[override], [type-arg] and [arg-type] errors. Make mypy keep treating
+urwid as untyped by not following its imports.
+
+urwid 4 also deepened its widget class hierarchy, which makes pylint
+report R0901 too-many-ancestors for the widget subclasses in qmp_tui.py.
+The ancestor count comes from urwid rather than from this code base, so
+disable that check.
+
+Both changes are backwards compatible with urwid 3.x.
+
+Bug-Debian: https://bugs.debian.org/1148059
+Forwarded: no
+---
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -96,8 +96,11 @@
+
+ # The following missing import directives are because these libraries do not
+ # provide type stubs. Allow them on an as-needed basis for mypy.
+-[mypy-urwid]
++# urwid >= 4.1 ships py.typed, but qmp_tui.py predates those annotations;
++# keep treating it as untyped.
++[mypy-urwid,urwid.*]
+ ignore_missing_imports = True
++follow_imports = skip
+
+ [mypy-urwid_readline]
+ ignore_missing_imports = True
+@@ -120,6 +123,7 @@
+         too-many-arguments,
+         too-many-function-args,  # mypy handles this with less false positives.
+         too-many-instance-attributes,
++        too-many-ancestors,  # urwid >= 4 widget hierarchy is deeper.
+         no-member,  # mypy also handles this better.
+         unknown-option-value,  # pre and post "too-many-positional-arguments"
+
diff -Nru python-qemu-qmp-0.0.6/debian/patches/series python-qemu-qmp-0.0.6/debian/patches/series
--- python-qemu-qmp-0.0.6/debian/patches/series    1969-12-31 19:00:00.000000000 -0500
+++ python-qemu-qmp-0.0.6/debian/patches/series    2026-09-17 15:27:37.000000000 -0400
@@ -0,0 +1 @@
+0001-Keep-linter-tests-passing-with-urwid-4.x.patch