gtk: Add more explicit version requirements#30533
Conversation
|
Note, this doesn't explicitly do |
|
What about try:
gi.require_version("GioUnix", "2.0")
except ValueError:
# GioUnix is not available on this platform, which is fine
passI tried it in #30535 |
8a720cb to
93a5b91
Compare
|
Sorry I was going down the issue list in order and merged #30535 before I got to this one. |
|
That is okay; this has turned into more of a cleanup on the tests a bit than fully fixing the original issue. |
93a5b91 to
7d56088
Compare
|
Is the test failure real? It's suspicious that a gtk test segfaults after this change. |
|
It does seem related, yes. Previously, GTK4 would never fully be hit by this test because GTK3 was already imported. How it manages to segfault though, I'm unsure just yet. |
7d56088 to
1ae4f92
Compare
It looks like the update to Ubuntu 24.04 fixed it. And since the |
1ae4f92 to
34fb109
Compare
This adds requirements for all of Gdk/GdkPixbuf before using them, as we do for Gtk. Note that Gio/GLib/GObject are already accepted without version by PyGObject as they are tied to the version it's compiled against. Fixes matplotlib#30525
This test has been an expected failure since it was created, and in that time, `gtk_test_widget_send_key` was never made to work, nor was a replacement found. In GTK4, that API doesn't exist either.
For example, GTK3 and GTK4 conflict, and which one is tested depends on which one loads first. Running in a subprocess ensures that both work, but we only do that for backends as adding ~100 more subprocesses is overkill.
34fb109 to
996736d
Compare
…rsion BASELINE RUN for Linux (ubuntu-22.04) and Windows (windows-latest) variants. Upstream changes: - backend_gtk3.py: Replace GioUnix with Gdk require_version - backend_gtk4.py: Add Gdk and GdkPixbuf require_version - test_backend_gtk3.py: Remove flaky test_correct_key test Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PR summary
This adds requirements for all of Gdk/GdkPixbuf
/Gio/GLib/GObjectbefore using them, as we do for Gtk.Note, Gdk is bunded with Gtk, so it's the only one that changes versions depending on backend.
Fixes #30525
PR checklist