Hello community,

here is the log from the commit of package python-gobject for openSUSE:Factory 
checked in at 2020-05-08 23:03:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-gobject (Old)
 and      /work/SRC/openSUSE:Factory/.python-gobject.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-gobject"

Fri May  8 23:03:55 2020 rev:82 rq:800817 version:3.36.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-gobject/python-gobject.changes    
2020-04-23 18:28:11.667830237 +0200
+++ /work/SRC/openSUSE:Factory/.python-gobject.new.2738/python-gobject.changes  
2020-05-08 23:03:58.081692658 +0200
@@ -1,0 +2,13 @@
+Wed May  6 17:15:26 UTC 2020 - Bjørn Lie <bjorn....@gmail.com>
+
+- Update to version 3.36.1:
+  + tests: Fix failing tests with pytest 5.4.0+.
+  + Gtk: Add override to make sure both
+    TreeModelSort.new_with_model and TreeModel.sort_new_with_model
+    exist independend of the gtk version.
+  + Gtk.Template: Fix initialisation order errors with Widgets
+    getting created from C (potentially through other templates).
+  + Gtk.Template: Fix errors when calling init_template() multiple
+    times.
+
+-------------------------------------------------------------------

Old:
----
  pygobject-3.36.0.tar.xz

New:
----
  pygobject-3.36.1.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-gobject.spec ++++++
--- /var/tmp/diff_new_pack.vTcMGP/_old  2020-05-08 23:03:58.673693867 +0200
+++ /var/tmp/diff_new_pack.vTcMGP/_new  2020-05-08 23:03:58.677693875 +0200
@@ -22,7 +22,7 @@
 %global __requires_exclude_from 
^%{python2_sitearch}/gi/__init__.py|%{python3_sitearch}/gi/__init__.py$
 %define _name   pygobject
 Name:           python-gobject
-Version:        3.36.0
+Version:        3.36.1
 Release:        0
 Summary:        Python bindings for GObject
 License:        LGPL-2.1-or-later

++++++ pygobject-3.36.0.tar.xz -> pygobject-3.36.1.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.36.0/.gitlab-ci.yml 
new/pygobject-3.36.1/.gitlab-ci.yml
--- old/pygobject-3.36.0/.gitlab-ci.yml 2020-03-08 10:10:35.942755000 +0100
+++ new/pygobject-3.36.1/.gitlab-ci.yml 2020-05-06 18:24:31.981574000 +0200
@@ -20,7 +20,7 @@
 .mingw-defaults: &mingw-defaults
   stage: build_and_test
   tags:
-    - win32
+    - win32-ps
   artifacts:
     paths:
       - coverage/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.36.0/NEWS new/pygobject-3.36.1/NEWS
--- old/pygobject-3.36.0/NEWS   2020-03-08 15:20:44.991336300 +0100
+++ new/pygobject-3.36.1/NEWS   2020-05-06 18:31:05.325494500 +0200
@@ -1,3 +1,14 @@
+3.36.1 - 2020-05-06
+-------------------
+
+* tests: Fix failing tests with pytest 5.4.0+
+* Gtk: Add override to make sure both TreeModelSort.new_with_model and
+  TreeModel.sort_new_with_model exist independend of the gtk version
+* Gtk.Template: Fix initialisation order errors with Widgets getting created 
from C
+  (potentially through other templates) :issue:`257` :issue:`386` :issue:`341` 
:mr:`140` (:user:`Jean Felder <jfelder>`)
+* Gtk.Template: Fix errors when calling init_template() multiple times 
:mr:`140` (:user:`Jean Felder <jfelder>`)
+
+
 3.36.0 - 2020-03-08
 -------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.36.0/PKG-INFO 
new/pygobject-3.36.1/PKG-INFO
--- old/pygobject-3.36.0/PKG-INFO       2020-03-08 15:24:07.806813700 +0100
+++ new/pygobject-3.36.1/PKG-INFO       2020-05-06 18:33:42.524525000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: PyGObject
-Version: 3.36.0
+Version: 3.36.1
 Summary: Python bindings for GObject Introspection
 Home-page: https://pygobject.readthedocs.io
 Author: James Henstridge
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.36.0/PyGObject.egg-info/PKG-INFO 
new/pygobject-3.36.1/PyGObject.egg-info/PKG-INFO
--- old/pygobject-3.36.0/PyGObject.egg-info/PKG-INFO    2020-03-08 
15:24:07.506801400 +0100
+++ new/pygobject-3.36.1/PyGObject.egg-info/PKG-INFO    2020-05-06 
18:33:42.216517400 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: PyGObject
-Version: 3.36.0
+Version: 3.36.1
 Summary: Python bindings for GObject Introspection
 Home-page: https://pygobject.readthedocs.io
 Author: James Henstridge
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.36.0/gi/_gtktemplate.py 
new/pygobject-3.36.1/gi/_gtktemplate.py
--- old/pygobject-3.36.0/gi/_gtktemplate.py     2019-12-30 12:13:06.357884400 
+0100
+++ new/pygobject-3.36.1/gi/_gtktemplate.py     2020-05-02 22:55:05.439876300 
+0200
@@ -99,7 +99,7 @@
 
 
 def init_template(self, cls, base_init_template):
-    self.init_template = lambda s: None
+    self.init_template = lambda: None
 
     if self.__class__ is not cls:
         raise TypeError(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.36.0/gi/gimodule.c 
new/pygobject-3.36.1/gi/gimodule.c
--- old/pygobject-3.36.0/gi/gimodule.c  2019-12-30 12:15:35.835093700 +0100
+++ new/pygobject-3.36.1/gi/gimodule.c  2020-05-06 18:24:31.985573800 +0200
@@ -1070,6 +1070,7 @@
     GObject *object = (GObject *) instance;
     PyObject *wrapper, *result;
     PyGILState_STATE state;
+    gboolean needs_init = FALSE;
 
     wrapper = g_object_get_qdata(object, pygobject_wrapper_key);
     if (wrapper == NULL) {
@@ -1096,16 +1097,20 @@
          * will take the ref */
         pygobject_ref_float ((PyGObject *) wrapper);
 
-        result = PyObject_CallMethod (wrapper, "__init__", NULL);
+        needs_init = TRUE;
+    }
+
+    /* XXX: used for Gtk.Template */
+    if (PyObject_HasAttrString ((PyObject*) Py_TYPE (wrapper), 
"__dontuse_ginstance_init__")) {
+        result = PyObject_CallMethod (wrapper, "__dontuse_ginstance_init__", 
NULL);
         if (result == NULL)
             PyErr_Print ();
         else
             Py_DECREF (result);
     }
 
-    /* XXX: used for Gtk.Template */
-    if (PyObject_HasAttrString ((PyObject*) Py_TYPE (wrapper), 
"__dontuse_ginstance_init__")) {
-        result = PyObject_CallMethod (wrapper, "__dontuse_ginstance_init__", 
NULL);
+    if (needs_init) {
+        result = PyObject_CallMethod (wrapper, "__init__", NULL);
         if (result == NULL)
             PyErr_Print ();
         else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.36.0/gi/overrides/Gtk.py 
new/pygobject-3.36.1/gi/overrides/Gtk.py
--- old/pygobject-3.36.0/gi/overrides/Gtk.py    2020-03-08 10:10:35.942755000 
+0100
+++ new/pygobject-3.36.1/gi/overrides/Gtk.py    2020-05-06 18:24:31.989573700 
+0200
@@ -834,6 +834,13 @@
                 raise IndexError("could not find tree path '%s'" % key)
             return aiter
 
+    def sort_new_with_model(self):
+        super_object = super(TreeModel, self)
+        if hasattr(super_object, "sort_new_with_model"):
+            return super_object.sort_new_with_model()
+        else:
+            return TreeModelSort.new_with_model(self)
+
     def _coerce_path(self, path):
         if isinstance(path, Gtk.TreePath):
             return path
@@ -973,6 +980,11 @@
                                arg_names=('model',),
                                category=PyGTKDeprecationWarning)
 
+    if not hasattr(Gtk.TreeModelSort, "new_with_model"):
+        @classmethod
+        def new_with_model(self, child_model):
+            return TreeModel.sort_new_with_model(child_model)
+
 
 TreeModelSort = override(TreeModelSort)
 __all__.append('TreeModelSort')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.36.0/meson.build 
new/pygobject-3.36.1/meson.build
--- old/pygobject-3.36.0/meson.build    2020-03-08 15:13:57.579728400 +0100
+++ new/pygobject-3.36.1/meson.build    2020-05-06 18:24:31.993573400 +0200
@@ -1,5 +1,5 @@
 project('pygobject', 'c',
-  version : '3.36.0',
+  version : '3.36.1',
   meson_version : '>= 0.46.0',
   default_options : [ 'warning_level=1',
                       'buildtype=debugoptimized'])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.36.0/setup.py 
new/pygobject-3.36.1/setup.py
--- old/pygobject-3.36.0/setup.py       2020-03-08 15:14:07.383750000 +0100
+++ new/pygobject-3.36.1/setup.py       2020-05-06 18:24:31.993573400 +0200
@@ -41,7 +41,7 @@
 from distutils.spawn import find_executable
 
 
-PYGOBJECT_VERSION = "3.36.0"
+PYGOBJECT_VERSION = "3.36.1"
 GLIB_VERSION_REQUIRED = "2.48.0"
 GI_VERSION_REQUIRED = "1.46.0"
 PYCAIRO_VERSION_REQUIRED = "1.11.1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.36.0/tests/test_glib.py 
new/pygobject-3.36.1/tests/test_glib.py
--- old/pygobject-3.36.0/tests/test_glib.py     2019-12-30 12:13:06.361884400 
+0100
+++ new/pygobject-3.36.1/tests/test_glib.py     2020-05-06 18:24:31.997573100 
+0200
@@ -18,7 +18,7 @@
 
 class TestGLib(unittest.TestCase):
 
-    @pytest.mark.xfail(strict=True)
+    @pytest.mark.xfail()
     def test_pytest_capture_error_in_closure(self):
         # this test is supposed to fail
         ml = GLib.MainLoop()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.36.0/tests/test_gtk_template.py 
new/pygobject-3.36.1/tests/test_gtk_template.py
--- old/pygobject-3.36.0/tests/test_gtk_template.py     2019-12-30 
12:15:35.839093700 +0100
+++ new/pygobject-3.36.1/tests/test_gtk_template.py     2020-05-06 
18:24:31.997573100 +0200
@@ -590,3 +590,103 @@
     child = child.get_children()[0]
     assert isinstance(child, Gtk.Label)
     assert child.props.label == "foo"
+
+
+def test_template_hierarchy():
+    testlabel = """
+    <interface>
+      <template class="TestLabel" parent="GtkLabel">
+      </template>
+     </interface>
+    """
+    @Gtk.Template(string=testlabel)
+    class TestLabel(Gtk.Label):
+
+        __gtype_name__ = "TestLabel"
+
+        def __init__(self):
+            super(TestLabel, self).__init__()
+            self.props.label = "TestLabel"
+
+    testbox = """
+    <interface>
+      <template class="TestBox" parent="GtkBox">
+        <child>
+          <object class="TestLabel" id="_testlabel"/>
+        </child>
+      </template>
+    </interface>
+    """
+    @Gtk.Template(string=testbox)
+    class TestBox(Gtk.Box):
+
+        __gtype_name__ = "TestBox"
+
+        _testlabel = Gtk.Template.Child()
+
+        def __init__(self):
+            super(TestBox, self).__init__()
+
+            assert isinstance(self._testlabel, TestLabel)
+
+    window = """
+    <interface>
+      <template class="MyWindow" parent="GtkWindow">
+        <property name="title">"Hellow World"</property>
+        <child>
+          <object class="TestBox" id="_testbox">
+            <child>
+              <object class="TestLabel" id="_testlabel"/>
+            </child>
+          </object>
+        </child>
+      </template>
+    </interface>
+    """
+    @Gtk.Template(string=window)
+    class MyWindow(Gtk.Window):
+
+        __gtype_name__ = "MyWindow"
+
+        _testbox = Gtk.Template.Child()
+        _testlabel = Gtk.Template.Child()
+
+        def __init__(self):
+            super(MyWindow, self).__init__()
+
+            assert isinstance(self._testbox, TestBox)
+            assert isinstance(self._testlabel, TestLabel)
+            assert len(self._testbox.get_children()) == 2
+
+    win = MyWindow()
+    assert isinstance(win, MyWindow)
+
+
+def test_multiple_init_template_calls():
+    xml = """
+    <interface>
+      <template class="MyBox" parent="GtkBox">
+        <child>
+          <object class="GtkLabel" id="_label"/>
+        </child>
+       </template>
+     </interface>
+    """
+    @Gtk.Template(string=xml)
+    class MyBox(Gtk.Box):
+
+        __gtype_name__ = "MyBox"
+
+        _label = Gtk.Template.Child()
+
+        def __init__(self):
+            super(MyBox, self).__init__()
+            self._label.props.label = "awesome label"
+
+    my_box = MyBox()
+    assert isinstance(my_box, MyBox)
+    assert len(my_box.get_children()) == 1
+
+    my_box.init_template()
+    assert isinstance(my_box, MyBox)
+    assert len(my_box.get_children()) == 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.36.0/tests/test_overrides_gtk.py 
new/pygobject-3.36.1/tests/test_overrides_gtk.py
--- old/pygobject-3.36.0/tests/test_overrides_gtk.py    2020-03-08 
10:10:32.174702400 +0100
+++ new/pygobject-3.36.1/tests/test_overrides_gtk.py    2020-05-06 
18:24:31.997573100 +0200
@@ -1148,6 +1148,21 @@
 @ignore_gi_deprecation_warnings
 @unittest.skipUnless(Gtk, 'Gtk not available')
 class TestTreeModel(unittest.TestCase):
+
+    def test_tree_model_sort_new_with_model_old(self):
+        # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1134
+        model = Gtk.TreeStore(int)
+        sort_model = model.sort_new_with_model()
+        assert isinstance(sort_model, Gtk.TreeModelSort)
+        assert sort_model.get_model() == model
+
+    def test_tree_model_sort_new_with_model_new(self):
+        # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1134
+        model = Gtk.TreeStore(int)
+        sort_model = Gtk.TreeModelSort.new_with_model(child_model=model)
+        assert isinstance(sort_model, Gtk.TreeModelSort)
+        assert sort_model.get_model() == model
+
     def test_tree_model_sort(self):
         self.assertEqual(Gtk.TreeModelSort, gi.overrides.Gtk.TreeModelSort)
         model = Gtk.TreeStore(int, bool)


Reply via email to