From 17979de74717d912f9e5edbdcb2eb0cb45aff3c8 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 26 Dec 2023 16:27:59 -0500 Subject: [PATCH] Fix tests with gtk4 --- 0001-Fix-tests-when-no-GTK3.patch | 29 +++++++++++++++++++++++++++++ pygobject3.spec | 3 +++ 2 files changed, 32 insertions(+) create mode 100644 0001-Fix-tests-when-no-GTK3.patch diff --git a/0001-Fix-tests-when-no-GTK3.patch b/0001-Fix-tests-when-no-GTK3.patch new file mode 100644 index 0000000..a8c10ee --- /dev/null +++ b/0001-Fix-tests-when-no-GTK3.patch @@ -0,0 +1,29 @@ +From 6f5a15e4c1a466dcc17bb2d64ef28842c4f7a000 Mon Sep 17 00:00:00 2001 +From: Arjan Molenaar +Date: Sun, 17 Sep 2023 22:39:29 +0200 +Subject: [PATCH] Fix tests when no GTK3 is installed + +The Atk module was not used, yet imported. Atk is not a GTK 4 module. +--- + tests/test_atoms.py | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/tests/test_atoms.py b/tests/test_atoms.py +index a74db38ce..febff78c1 100644 +--- a/tests/test_atoms.py ++++ b/tests/test_atoms.py +@@ -2,10 +2,9 @@ import os + import unittest + + try: +- from gi.repository import Gtk, Atk, Gdk ++ from gi.repository import Gtk, Gdk + except ImportError: + Gdk = None +- Atk = None + Gtk = None + + from .helper import capture_glib_deprecation_warnings +-- +GitLab + diff --git a/pygobject3.spec b/pygobject3.spec index 7f91a0f..34568f5 100644 --- a/pygobject3.spec +++ b/pygobject3.spec @@ -11,6 +11,8 @@ Summary: Python bindings for GObject Introspection License: LGPL-2.1-or-later URL: https://wiki.gnome.org/Projects/PyGObject Source0: https://download.gnome.org/sources/pygobject/3.46/pygobject-%{version}.tar.xz +# gtk4 no longer uses atk +Patch0: 0001-Fix-tests-when-no-GTK3.patch BuildRequires: pkgconfig(cairo-gobject) BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version} @@ -84,6 +86,7 @@ This package contains files required to embed PyGObject %meson_install %check +export TEST_GTK_VERSION=4.0 %{shrink:xvfb-run -s "-screen 0 1600x1200x24" %meson_test --timeout-multiplier=5}