Imported Upstream version 3.32.2 upstream/3.32.2
authorDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 25 Nov 2020 05:48:45 +0000 (14:48 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 25 Nov 2020 05:48:45 +0000 (14:48 +0900)
.gitlab-ci/test-msys2.sh
NEWS
gi/pygobject-object.c
meson.build
setup.py
tests/test_overrides_gtk.py

index 5e92370..9f3d875 100755 (executable)
@@ -54,10 +54,11 @@ export PYTHONDEVMODE=1
 $PYTHON setup.py build_tests
 MSYSTEM= $PYTHON -m coverage run tests/runtests.py
 
-curl -O -J -L "https://github.com/linux-test-project/lcov/archive/master.tar.gz"
-tar -xvzf lcov-master.tar.gz
+# FIXME: lcov doesn't support gcc9
+#~ curl -O -J -L "https://github.com/linux-test-project/lcov/archive/master.tar.gz"
+#~ tar -xvzf lcov-master.tar.gz
 
-./lcov-master/bin/lcov \
-    --rc lcov_branch_coverage=1 --no-external \
-    --directory . --capture --output-file \
-    "${COV_DIR}/${COV_KEY}.lcov"
+#~ ./lcov-master/bin/lcov \
+    #~ --rc lcov_branch_coverage=1 --no-external \
+    #~ --directory . --capture --output-file \
+    #~ "${COV_DIR}/${COV_KEY}.lcov"
diff --git a/NEWS b/NEWS
index ca71a7b..2db215c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+3.32.2 - 2019-06-23
+-------------------
+
+* Python 3.8b1 compatibility fixes
+* tests: fix a test error when run under wayland
+* setup.py: specify python_requires
+
+
 3.32.1 - 2019-04-20
 -------------------
 
index dbf46e1..39c03ca 100644 (file)
@@ -878,7 +878,10 @@ pygobject_inherit_slots(PyTypeObject *type, PyObject *bases, gboolean check_for_
                                   offsetof(PyTypeObject, tp_iter),
                                   offsetof(PyTypeObject, tp_repr),
                                   offsetof(PyTypeObject, tp_str),
-                                  offsetof(PyTypeObject, tp_print) };
+#if PY_VERSION_HEX < 0x03000000
+                                  offsetof(PyTypeObject, tp_print),
+#endif
+    };
     gsize i;
 
     /* Happens when registering gobject.GObject itself, at least. */
index d27a005..2064d25 100644 (file)
@@ -1,5 +1,5 @@
 project('pygobject', 'c',
-  version : '3.32.1',
+  version : '3.32.2',
   meson_version : '>= 0.46.0',
   default_options : [ 'warning_level=1',
                       'buildtype=debugoptimized'])
@@ -72,7 +72,6 @@ else
     '-Wall',
     '-Warray-bounds',
     '-Wcast-align',
-    '-Wdeclaration-after-statement',
     '-Wduplicated-branches',
     '-Wextra',
     '-Wformat=2',
@@ -98,11 +97,18 @@ else
     '-Wsign-compare',
     '-Wstrict-aliasing',
     '-Wstrict-prototypes',
+    '-Wswitch-default',
     '-Wundef',
     '-Wunused-but-set-variable',
     '-Wwrite-strings',
   ]
 
+  if python.language_version().split('.')[0] == '2'
+    main_c_args += [
+        '-Wdeclaration-after-statement',
+    ]
+  endif
+
   main_c_args += [
     '-Wno-incompatible-pointer-types-discards-qualifiers',
     '-Wno-missing-field-initializers',
@@ -118,12 +124,6 @@ else
     '-fvisibility=hidden',
   ]
 
-  if not ['3.3', '3.4'].contains(python.language_version())
-    main_c_args += [
-      '-Wswitch-default',
-    ]
-  endif
-
   main_c_args = cc.get_supported_arguments(main_c_args)
 endif
 
index f003b5b..6f6f86d 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,7 @@ from distutils import dir_util, log
 from distutils.spawn import find_executable
 
 
-PYGOBJECT_VERSION = "3.32.1"
+PYGOBJECT_VERSION = "3.32.2"
 GLIB_VERSION_REQUIRED = "2.48.0"
 GI_VERSION_REQUIRED = "1.46.0"
 PYCAIRO_VERSION_REQUIRED = "1.11.1"
@@ -975,7 +975,6 @@ def add_ext_compiler_flags(ext, compiler, _cache={}):
                 "-Wall",
                 "-Warray-bounds",
                 "-Wcast-align",
-                "-Wdeclaration-after-statement",
                 "-Wduplicated-branches",
                 "-Wextra",
                 "-Wformat=2",
@@ -1001,14 +1000,15 @@ def add_ext_compiler_flags(ext, compiler, _cache={}):
                 "-Wsign-compare",
                 "-Wstrict-aliasing",
                 "-Wstrict-prototypes",
+                "-Wswitch-default",
                 "-Wundef",
                 "-Wunused-but-set-variable",
                 "-Wwrite-strings",
             ]
 
-            if sys.version_info[:2] != (3, 4):
+            if sys.version_info[0] == 2:
                 args += [
-                    "-Wswitch-default",
+                    "-Wdeclaration-after-statement",
                 ]
 
             args += [
@@ -1272,6 +1272,8 @@ def main():
             "install_pkgconfig": install_pkgconfig,
         },
         install_requires=install_requires,
+        python_requires=(
+            '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4'),
         data_files=[
             ('include/pygobject-3.0', ['gi/pygobject.h']),
         ],
index 627d576..d791e24 100644 (file)
@@ -6,10 +6,10 @@ from __future__ import absolute_import
 
 import contextlib
 import unittest
-import time
 import sys
 import gc
 import warnings
+import timeit
 
 import pytest
 
@@ -150,11 +150,7 @@ def test_wrapper_toggle_refs():
     del b
     gc.collect()
     gc.collect()
-    if GTK4:
-        # XXX: Why?
-        assert w.get_preferred_size().minimum_size.height == height + 10
-    else:
-        assert w.get_preferred_size().minimum_size.height == height
+    assert w.get_preferred_size().minimum_size.height >= height
 
 
 @unittest.skipUnless(Gtk, 'Gtk not available')
@@ -2260,12 +2256,12 @@ class TestTreeModel(unittest.TestCase):
         model = Gtk.ListStore(int, str)
 
         iterations = 2000
-        start = time.clock()
+        start = timeit.default_timer()
         i = iterations
         while i > 0:
             model.append([1, 'hello'])
             i -= 1
-        end = time.clock()
+        end = timeit.default_timer()
         sys.stderr.write('[%.0f µs/append] ' % ((end - start) * 1000000 / iterations))
 
     def test_filter_new_default(self):