diff --git a/0001-revert-override-of-connection.register_object.patch b/0001-revert-override-of-connection.register_object.patch new file mode 100644 index 0000000000000000000000000000000000000000..d80c18c58d865e77625de65dfa69a0e317fdc93b --- /dev/null +++ b/0001-revert-override-of-connection.register_object.patch @@ -0,0 +1,140 @@ +From e86c32092e693ecffcec211133fd1929603948d1 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Sat, 30 Nov 2024 14:59:49 -0800 +Subject: [PATCH] revert override of connection.register_object + +This seems to break the exit handler of anaconda (Fedora/RHEL +installer), such that it often fails to exit properly. + +Signed-off-by: Adam Williamson +--- + gi/overrides/Gio.py | 31 ------------------- + tests/test_gdbus.py | 73 --------------------------------------------- + 2 files changed, 104 deletions(-) + +diff --git a/gi/overrides/Gio.py b/gi/overrides/Gio.py +index 48c3737a..45256385 100644 +--- a/gi/overrides/Gio.py ++++ b/gi/overrides/Gio.py +@@ -89,37 +89,6 @@ class DBusArgInfo(Gio.DBusArgInfo): + __all__.append('DBusArgInfo') + + +-@override +-class DBusConnection(Gio.DBusConnection): +- __init__ = _warn_init(Gio.DBusConnection) +- +- def register_object(self, +- object_path, +- interface_info, +- method_call_closure=None, +- get_property_closure=None, +- set_property_closure=None): +- if method_call_closure is not None: +- def wrapped_method_call_closure(connection, sender, object_path, +- interface_name, method_name, parameters, +- invocation): +- method_call_closure(connection, sender, object_path, +- interface_name, method_name, parameters, +- invocation) +- invocation._unref() +- else: +- wrapped_method_call_closure = None +- +- return super().register_object(object_path, +- interface_info, +- wrapped_method_call_closure, +- get_property_closure, +- set_property_closure) +- +- +-__all__.append('DBusConnection') +- +- + @override + class DBusMethodInfo(Gio.DBusMethodInfo): + __init__ = _warn_init(Gio.DBusMethodInfo) +diff --git a/tests/test_gdbus.py b/tests/test_gdbus.py +index afbf94cb..18fd0e41 100644 +--- a/tests/test_gdbus.py ++++ b/tests/test_gdbus.py +@@ -284,76 +284,3 @@ class TestDBusConnection: + ): + reg_id = bus.register_object(**kwargs) + bus.unregister_object(reg_id) +- +- @unittest.skipUnless(has_dbus, "no dbus running") +- def test_connection_invocation_ref_count(self): +- """Invocation object should not leak a reference.""" +- invocation, errors = self.run_server(self.client_call) +- +- assert not errors +- assert invocation +- assert invocation.ref_count == 1 +- +- def run_server(self, client_callback): +- self.invocation = None +- self.errors = [] +- self.loop = GLib.MainLoop() +- +- def on_name_acquired(bus, name): +- client_callback(bus) +- +- self.reg_id = None +- bus = Gio.bus_get_sync(Gio.BusType.SESSION) +- owner_id = Gio.bus_own_name(Gio.BusType.SESSION, +- "org.pygobject.Test", +- Gio.BusNameOwnerFlags.NONE, +- self.on_bus_acquired, +- on_name_acquired, +- self.on_name_lost) +- try: +- self.loop.run() +- finally: +- Gio.bus_unown_name(owner_id) +- if self.reg_id: +- bus.unregister_object(self.reg_id) +- +- return (self.invocation, self.errors) +- +- def on_name_lost(self, _bus, name): +- self.errors.append(f"Name {name} lost") +- self.loop.quit() +- +- def on_bus_acquired(self, bus, name): +- interface_xml = """ +- +- +- +- +- """ +- self.reg_id = bus.register_object("/pygobject/Test", +- Gio.DBusNodeInfo.new_for_xml(interface_xml).interfaces[0], +- self.on_incoming_method_call, +- None, +- None) +- +- def on_incoming_method_call(self, bus, sender, object_path, interface_name, method_name, parameters, invocation): +- invocation.return_value(GLib.Variant("()", ())) +- self.invocation = invocation +- +- def client_call(self, bus): +- +- def call_done(obj, result): +- try: +- obj.call_finish(result) +- finally: +- self.loop.quit() +- +- bus.call("org.pygobject.Test", +- "/pygobject/Test", +- "org.pygobject.Test", +- "test", +- parameters=None, +- reply_type=None, +- flags=Gio.DBusCallFlags.NONE, +- timeout_msec=5000, +- callback=call_done) +-- +2.47.0 + diff --git a/pygobject-3.46.0.tar.xz b/pygobject-3.46.0.tar.xz deleted file mode 100644 index 9d60a8713de289a1d3b0834bd2f85b524750a60d..0000000000000000000000000000000000000000 Binary files a/pygobject-3.46.0.tar.xz and /dev/null differ diff --git a/pygobject-3.50.0.tar.xz b/pygobject-3.50.0.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..1d41b064ba21f16cc78a94c1a91cf1cdba5bd589 Binary files /dev/null and b/pygobject-3.50.0.tar.xz differ diff --git a/pygobject3.spec b/pygobject3.spec index cc82c8e37894fad5439eb8dcebf1691ce896e015..c13837343d639a7a85e01cf1fdefbb2b17dff679 100644 --- a/pygobject3.spec +++ b/pygobject3.spec @@ -1,22 +1,35 @@ %global __requires_exclude typelib\\(%%namespaces\\) -%global __requires_exclude_from ^%{python3_sitelib}/pygtkcompat/.*$ +%global __requires_exclude_from ^%{python3_sitearch}/pygtkcompat/.*$ Name: pygobject3 -Version: 3.46.0 -Release: 3 +Version: 3.50.0 +Release: 1 Summary: Provides bindings for GObject based libraries License: LGPL-2.1-or-later and MIT -URL: https://wiki.gnome.org/Projects/PyGObject -Source0: https://download.gnome.org/sources/pygobject/3.46/pygobject-%{version}.tar.xz +URL: https://pygobject.gnome.org/ +Source0: https://download.gnome.org/sources/pygobject/3.50/pygobject-%{version}.tar.xz # Drop GIMarshallingTests - It's test suite remainders that should not be installed Patch0: pygobject-do-not-install-GIMarshallingTests.patch -BuildRequires: glib2-devel >= 2.64.0 gobject-introspection-devel >= 1.64.0 -BuildRequires: meson cairo-gobject-devel -BuildRequires: python3-devel >= 3.8 python3-cairo-devel >= 1.16.0 +# https://bugzilla.redhat.com/show_bug.cgi?id=2329587 +# https://gitlab.gnome.org/GNOME/pygobject/-/issues/658 +# Revert override of connection.register_object to avoid breaking anaconda +Patch1: 0001-revert-override-of-connection.register_object.patch + +BuildRequires: meson >= 0.64.0 +BuildRequires: pkgconfig(cairo) +BuildRequires: pkgconfig(cairo-gobject) +BuildRequires: pkgconfig(gio-2.0) >= 2.64.0 +BuildRequires: pkgconfig(glib-2.0) >= 2.64.0 +BuildRequires: pkgconfig(gmodule-2.0) >= 2.64.0 +BuildRequires: pkgconfig(gobject-2.0) >= 2.64.0 +BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.64.0 +BuildRequires: pkgconfig(libffi) >= 3.0 +BuildRequires: python3-devel >= 3.9 +BuildRequires: python3-cairo-devel >= 1.16.0 #for test suite -BuildRequires: python3-pytest gtk3 dbus-x11 dejavu-fonts xorg-x11-server-Xvfb +BuildRequires: python3-pytest gtk3 xorg-x11-server-Xvfb %description PyGObject is a Python package which provides bindings for GObject based libraries such as @@ -28,7 +41,7 @@ typelib file (Gtk-3.0.typelib) and dynamically provides a Python interface based %package -n python3-gobject Summary: GObject library wrapper for python 3 Requires: python3-gobject-base%{?_isa} = %{version}-%{release} -Requires: python3-cairo%{?_isa} +Requires: python3-cairo%{?_isa} >= 1.16.0 %description -n python3-gobject The python3-gobject package provides a convenient wrapper for the GObject @@ -37,7 +50,7 @@ for use in Python 3 programs. %package -n python3-gobject-base Summary: base package for python3-gobject package -Requires: gobject-introspection%{?_isa} +Requires: gobject-introspection%{?_isa} >= 1.64.0 Provides: python%{python3_version}dist(pygobject) = %{version} %description -n python3-gobject-base @@ -47,7 +60,7 @@ library. %package devel Summary: Development files for %{name} Requires: python3-gobject%{?_isa} = %{version}-%{release} -Requires: gobject-introspection-devel%{?_isa} +Requires: gobject-introspection-devel%{?_isa} >= 1.64.0 %description devel This package contains files required to embed PyGObject @@ -63,7 +76,8 @@ This package contains files required to embed PyGObject %meson_install %check -xvfb-run %{__python3} setup.py test +export TEST_GTK_VERSION=3.0 +%{shrink:xvfb-run %meson_test} %files -n python3-gobject %{python3_sitearch}/gi/_gi_cairo*.so @@ -71,21 +85,24 @@ xvfb-run %{__python3} setup.py test %files -n python3-gobject-base %license COPYING %doc NEWS -%dir %{python3_sitearch}/gi -%{python3_sitearch}/gi/* -%{python3_sitearch}/PyGObject-*.egg-info -%exclude %{python3_sitearch}/gi/_gi_cairo*.so -%dir %{python3_sitelib}/gi/ -%{python3_sitelib}/gi/* -%{python3_sitelib}/pygtkcompat/ +%dir %{python3_sitearch}/gi/ +%{python3_sitearch}/gi/overrides/ +%{python3_sitearch}/gi/repository/ +%{python3_sitearch}/gi/_gi.*.so +%{python3_sitearch}/gi/*.py +%{python3_sitearch}/gi/__pycache__ +%{python3_sitearch}/PyGObject-*.dist-info/ +%{python3_sitearch}/pygtkcompat/ %files devel +%dir %{_includedir}/pygobject-3.0 %{_includedir}/pygobject-3.0/pygobject.h -%doc examples/ -%dir %{_includedir}/pygobject-3.0/ %{_libdir}/pkgconfig/pygobject-3.0.pc %changelog +* Tue Feb 04 2025 Funda Wang - 3.50.0-1 +- update to 3.50.0 + * Fri Oct 18 2024 Funda Wang - 3.46.0-3 - filter out wrong requires