-
-
Notifications
You must be signed in to change notification settings - Fork 8k
gtk: Add more explicit version requirements #30533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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
pass I 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. |
@@ -5,51 +5,6 @@ | |||
from unittest import mock | |||
|
|||
|
|||
@pytest.mark.backend("gtk3agg", skip_on_importerror=True) | |||
def test_correct_key(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be pushed into (yet another) subprocess rather than remaved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gtk_test_widget_send_key
has never really worked, I don't think. Even as a standalone script it doesn't finish (the receive
callback is never called.)
7d56088
to
1ae4f92
Compare
It looks like the update to Ubuntu 24.04 fixed it. And since the |
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.
1ae4f92
to
34fb109
Compare
PR summary
This adds requirements for all of Gdk/GdkPixbuf/Gio/GLib/GObject before 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