Hello community, here is the log from the commit of package python-gobject for openSUSE:Factory checked in at 2018-12-05 09:38:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-gobject (Old) and /work/SRC/openSUSE:Factory/.python-gobject.new.19453 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-gobject" Wed Dec 5 09:38:38 2018 rev:75 rq:653520 version:3.30.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-gobject/python-gobject.changes 2018-10-17 08:17:30.546965026 +0200 +++ /work/SRC/openSUSE:Factory/.python-gobject.new.19453/python-gobject.changes 2018-12-05 09:38:41.753013566 +0100 @@ -1,0 +2,30 @@ +Sun Dec 2 10:20:18 UTC 2018 - bjorn....@gmail.com + +- Update to version 3.30.4: + + gtk overrides: Fix rows getting inserted on the wrong level + with TreeStore.insert_before/inster_after if parent=None. + +------------------------------------------------------------------- +Tue Nov 27 18:17:55 UTC 2018 - bjorn....@gmail.com + +- Update to version 3.30.3: + + GValue: fall back to the custom C marshaller to support + fundamental types. This makes GValue work with GstFraction. + + GValue: Work around wrong annotations for GVariant. + + Fix GObject attribute access during instance init which can + lead to errors with __getattr__ implementations of subclasses. + This lead to criticals when instantiating Gio.DBusProxy. + +------------------------------------------------------------------- +Mon Nov 12 09:44:44 UTC 2018 - bjorn....@gmail.com + +- Update to version 3.30.2: + + tests: Fix some test with newer glib. + + overrides: Fix crash when using non-ascii text with + Gtk.Builder.add_from_string/add_objects_from_string. + + Various meson/distutils build fixes for MSVC. + + foreign-cairo: Fix cairo marshalling not using the foreign + converters in some cases. + + build: setup.py reproducible build fixes. + +------------------------------------------------------------------- Old: ---- pygobject-3.30.1.tar.xz New: ---- pygobject-3.30.4.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-gobject.spec ++++++ --- /var/tmp/diff_new_pack.dcuPDX/_old 2018-12-05 09:38:42.437012817 +0100 +++ /var/tmp/diff_new_pack.dcuPDX/_new 2018-12-05 09:38:42.437012817 +0100 @@ -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.30.1 +Version: 3.30.4 Release: 0 Summary: Python bindings for GObject License: LGPL-2.1-or-later ++++++ pygobject-3.30.1.tar.xz -> pygobject-3.30.4.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/.gitlab-ci/test-docker.sh new/pygobject-3.30.4/.gitlab-ci/test-docker.sh --- old/pygobject-3.30.1/.gitlab-ci/test-docker.sh 2018-08-20 17:59:38.000000000 +0200 +++ new/pygobject-3.30.4/.gitlab-ci/test-docker.sh 2018-11-25 23:06:50.000000000 +0100 @@ -27,7 +27,7 @@ export CFLAGS="-coverage -ftest-coverage -fprofile-arcs -Werror" # MESON -/usr/bin/python3 -m pip install --user git+https://github.com/mesonbuild/meson.git +/usr/bin/python3 -m pip install --user meson export PATH="${HOME}/.local/bin:${PATH}" export PKG_CONFIG_PATH="$(python -c 'import sys; sys.stdout.write(sys.prefix)')/lib/pkgconfig" # pycairo install under PyPy doesn't install a .pc file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/NEWS new/pygobject-3.30.4/NEWS --- old/pygobject-3.30.1/NEWS 2018-09-14 20:49:17.000000000 +0200 +++ new/pygobject-3.30.4/NEWS 2018-11-30 20:18:02.000000000 +0100 @@ -1,3 +1,37 @@ +3.30.4 - 2018-11-30 +------------------- + +* gtk overrides: Fix rows getting inserted on the wrong level with + TreeStore.insert_before/inster_after if parent=None. + :issue:`281` (3.30 regression, thanks to :user:`Cian Wilson <cianwilson>` + for the report) + + +3.30.3 - 2018-11-27 +------------------- + +* GValue: fall back to the custom C marshaller to support fundamental types. + This makes GValue work with GstFraction. :issue:`280` +* GValue: Work around wrong annotations for GVariant +* Fix GObject attribute access during instance init which can lead to errors + with __getattr__ implementations of subclasses. This lead to criticals when + instantiating Gio.DBusProxy. :issue:`267` + + +3.30.2 - 2018-11-11 +------------------- + +* tests: Fix some test with newer glib. +* overrides: Fix crash when using non-ascii text with. + Gtk.Builder.add_from_string/add_objects_from_string. :issue:`255` +* Various meson/distutils build fixes for MSVC. + :mr:`91` (:user:`Chun-wei Fan <fanc999>`) +* foreign-cairo: Fix cairo marshalling not using the foreign converters in + some cases. :issue:`260` +* build: setup.py reproducible build fixes. + :mr:`94` (:user:`Bernhard M. Wiedemann <bmwiedemann>`) + + 3.30.1 - 2018-09-14 ------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/PKG-INFO new/pygobject-3.30.4/PKG-INFO --- old/pygobject-3.30.1/PKG-INFO 2018-09-14 20:55:01.000000000 +0200 +++ new/pygobject-3.30.4/PKG-INFO 2018-11-30 21:07:36.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: PyGObject -Version: 3.30.1 +Version: 3.30.4 Summary: Python bindings for GObject Introspection Home-page: https://pygobject.readthedocs.io Author: James Henstridge @@ -34,7 +34,7 @@ Platform: POSIX, Windows Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) +Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+) Classifier: Operating System :: POSIX Classifier: Operating System :: Microsoft :: Windows Classifier: Programming Language :: C diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/PKG-INFO.in new/pygobject-3.30.4/PKG-INFO.in --- old/pygobject-3.30.1/PKG-INFO.in 2018-04-13 21:02:21.000000000 +0200 +++ new/pygobject-3.30.4/PKG-INFO.in 2018-11-30 20:14:49.000000000 +0100 @@ -12,7 +12,7 @@ Platform: POSIX, Windows Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) +Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+) Classifier: Operating System :: POSIX Classifier: Operating System :: Microsoft :: Windows Classifier: Programming Language :: C diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/PyGObject.egg-info/PKG-INFO new/pygobject-3.30.4/PyGObject.egg-info/PKG-INFO --- old/pygobject-3.30.1/PyGObject.egg-info/PKG-INFO 2018-09-14 20:55:00.000000000 +0200 +++ new/pygobject-3.30.4/PyGObject.egg-info/PKG-INFO 2018-11-30 21:07:36.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: PyGObject -Version: 3.30.1 +Version: 3.30.4 Summary: Python bindings for GObject Introspection Home-page: https://pygobject.readthedocs.io Author: James Henstridge @@ -34,7 +34,7 @@ Platform: POSIX, Windows Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) +Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+) Classifier: Operating System :: POSIX Classifier: Operating System :: Microsoft :: Windows Classifier: Programming Language :: C diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/gi/__init__.py new/pygobject-3.30.4/gi/__init__.py --- old/pygobject-3.30.1/gi/__init__.py 2018-05-31 17:11:33.000000000 +0200 +++ new/pygobject-3.30.4/gi/__init__.py 2018-11-25 23:06:50.000000000 +0100 @@ -62,6 +62,8 @@ version_info = _gi.pygobject_version[:] __version__ = "{0}.{1}.{2}".format(*version_info) +_gi.register_foreign() + class _DummyStaticModule(types.ModuleType): __path__ = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/gi/gimodule.c new/pygobject-3.30.4/gi/gimodule.c --- old/pygobject-3.30.1/gi/gimodule.c 2018-08-30 18:16:14.000000000 +0200 +++ new/pygobject-3.30.4/gi/gimodule.c 2018-11-26 22:31:33.000000000 +0100 @@ -1066,7 +1066,7 @@ } /* XXX: used for Gtk.Template */ - if (PyObject_HasAttrString (wrapper, "__dontuse_ginstance_init__")) { + if (PyObject_HasAttrString ((PyObject*) Py_TYPE (wrapper), "__dontuse_ginstance_init__")) { result = PyObject_CallMethod (wrapper, "__dontuse_ginstance_init__", NULL); if (result == NULL) PyErr_Print (); @@ -2279,6 +2279,7 @@ { "source_set_callback", (PyCFunction) pygi_source_set_callback, METH_VARARGS }, { "io_channel_read", (PyCFunction) pyg_channel_read, METH_VARARGS }, { "require_foreign", (PyCFunction) pygi_require_foreign, METH_VARARGS | METH_KEYWORDS }, + { "register_foreign", (PyCFunction) pygi_register_foreign, METH_NOARGS }, { "spawn_async", (PyCFunction)pyglib_spawn_async, METH_VARARGS|METH_KEYWORDS, "spawn_async(argv, envp=None, working_directory=None,\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/gi/overrides/GObject.py new/pygobject-3.30.4/gi/overrides/GObject.py --- old/pygobject-3.30.1/gi/overrides/GObject.py 2018-08-20 17:59:38.000000000 +0200 +++ new/pygobject-3.30.4/gi/overrides/GObject.py 2018-11-30 19:56:56.000000000 +0100 @@ -297,7 +297,9 @@ elif gtype == TYPE_PYOBJECT: self.set_boxed(py_value) else: - raise TypeError("Unknown value type %s" % gtype) + # Fall back to _gvalue_set which handles some more cases + # like fundamentals for which a converter is registered + _gi._gvalue_set(self, py_value) def get_value(self): gtype = self.g_type @@ -343,11 +345,15 @@ elif gtype == TYPE_GTYPE: return self.get_gtype() elif gtype == TYPE_VARIANT: - return self.get_variant() + # get_variant was missing annotations + # https://gitlab.gnome.org/GNOME/glib/merge_requests/492 + return self.dup_variant() elif gtype == TYPE_PYOBJECT: - pass - else: + return self.get_boxed() + elif gtype == _gi.TYPE_INVALID: return None + else: + return _gi._gvalue_get(self) def __repr__(self): return '<Value (%s) %s>' % (self.g_type.name, self.get_value()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/gi/overrides/Gtk.py new/pygobject-3.30.4/gi/overrides/Gtk.py --- old/pygobject-3.30.1/gi/overrides/Gtk.py 2018-08-20 17:59:38.000000000 +0200 +++ new/pygobject-3.30.4/gi/overrides/Gtk.py 2018-11-30 19:56:56.000000000 +0100 @@ -412,7 +412,7 @@ if not isinstance(buffer, string_types): raise TypeError('buffer must be a string') - length = len(buffer.encode('UTF-8')) + length = _get_utf8_length(buffer) return Gtk.UIManager.add_ui_from_string(self, buffer, length) @@ -462,6 +462,14 @@ __all__.append('MenuItem') +def _get_utf8_length(string): + if not isinstance(string, string_types): + raise TypeError('must be a string') + if not isinstance(string, bytes): + string = string.encode("utf-8") + return len(string) + + class Builder(Gtk.Builder): def connect_signals(self, obj_or_map): """Connect signals specified by this builder to a name, handler mapping. @@ -481,7 +489,7 @@ if not isinstance(buffer, string_types): raise TypeError('buffer must be a string') - length = len(buffer) + length = _get_utf8_length(buffer) return Gtk.Builder.add_from_string(self, buffer, length) @@ -489,7 +497,7 @@ if not isinstance(buffer, string_types): raise TypeError('buffer must be a string') - length = len(buffer) + length = _get_utf8_length(buffer) return Gtk.Builder.add_objects_from_string(self, buffer, length, object_ids) @@ -1274,6 +1282,8 @@ if sibling is None: position = -1 else: + if parent is None: + parent = self.iter_parent(sibling) position = self.get_path(sibling).get_indices()[-1] return self._do_insert(parent, position, row) @@ -1284,6 +1294,8 @@ if sibling is None: position = 0 else: + if parent is None: + parent = self.iter_parent(sibling) position = self.get_path(sibling).get_indices()[-1] + 1 return self._do_insert(parent, position, row) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/gi/pygi-closure.c new/pygobject-3.30.4/gi/pygi-closure.c --- old/pygobject-3.30.1/gi/pygi-closure.c 2018-09-14 16:06:08.000000000 +0200 +++ new/pygobject-3.30.4/gi/pygi-closure.c 2018-11-25 23:06:50.000000000 +0100 @@ -104,14 +104,14 @@ *(ffi_arg *) retval = arg->v_uint; break; default: - *(ffi_arg *) retval = arg->v_pointer; + *(ffi_arg *) retval = (ffi_arg) arg->v_pointer; break; } break; } default: - *(ffi_arg *) retval = arg->v_pointer; + *(ffi_arg *) retval = (ffi_arg) arg->v_pointer; break; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/gi/pygi-foreign-cairo.c new/pygobject-3.30.4/gi/pygi-foreign-cairo.c --- old/pygobject-3.30.1/gi/pygi-foreign-cairo.c 2018-05-31 17:11:33.000000000 +0200 +++ new/pygobject-3.30.4/gi/pygi-foreign-cairo.c 2018-11-30 19:56:56.000000000 +0100 @@ -539,6 +539,8 @@ static PyMethodDef _gi_cairo_functions[] = { {0,} }; PYGLIB_MODULE_START(_gi_cairo, "_gi_cairo") { + PyObject *gobject_mod; + #if PY_VERSION_HEX < 0x03000000 Pycairo_IMPORT; #else @@ -548,7 +550,10 @@ if (Pycairo_CAPI == NULL) return PYGLIB_MODULE_ERROR_RETURN; - pygobject_init (3, 13, 2); + gobject_mod = pygobject_init (3, 13, 2); + if (gobject_mod == NULL) + return PYGLIB_MODULE_ERROR_RETURN; + Py_DECREF (gobject_mod); pygi_register_foreign_struct ("cairo", "Matrix", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/gi/pygi-foreign.c new/pygobject-3.30.4/gi/pygi-foreign.c --- old/pygobject-3.30.1/gi/pygi-foreign.c 2018-05-31 17:11:33.000000000 +0200 +++ new/pygobject-3.30.4/gi/pygi-foreign.c 2018-11-25 23:06:50.000000000 +0100 @@ -217,3 +217,19 @@ return 0; } + + +PyObject *pygi_register_foreign (PyObject *self, PyObject *args) +{ + /* We need to try loading the foreign modules upfront so the GType + * converters are registered: + * https://gitlab.gnome.org/GNOME/pygobject/issues/260 + */ + PyObject *mod = pygi_struct_foreign_load_module ("cairo"); + if (mod == NULL) + PyErr_Clear (); + else + Py_DECREF (mod); + + Py_RETURN_NONE; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/gi/pygi-foreign.h new/pygobject-3.30.4/gi/pygi-foreign.h --- old/pygobject-3.30.1/gi/pygi-foreign.h 2018-05-31 17:11:33.000000000 +0200 +++ new/pygobject-3.30.4/gi/pygi-foreign.h 2018-11-25 23:06:50.000000000 +0100 @@ -50,4 +50,6 @@ int pygi_foreign_init (void); +PyObject *pygi_register_foreign (PyObject *self, PyObject *args); + #endif /* __PYGI_FOREIGN_H__ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/meson.build new/pygobject-3.30.4/meson.build --- old/pygobject-3.30.1/meson.build 2018-09-14 20:45:24.000000000 +0200 +++ new/pygobject-3.30.4/meson.build 2018-11-30 19:56:56.000000000 +0100 @@ -1,5 +1,5 @@ project('pygobject', 'c', - version : '3.30.1', + version : '3.30.4', meson_version : '>= 0.46.0', default_options : [ 'warning_level=1', 'buildtype=debugoptimized']) @@ -37,9 +37,18 @@ with_pycairo = get_option('pycairo') +cc = meson.get_compiler('c') + if with_pycairo - cairo_dep = dependency('cairo') - cairo_gobject_dep = dependency('cairo-gobject') + cairo_dep = dependency('cairo', required: cc.get_id() != 'msvc') + cairo_gobject_dep = dependency('cairo-gobject', required: cc.get_id() != 'msvc') + + if cc.get_id() == 'msvc' and (not cairo_gobject_dep.found() or not cairo_dep.found()) + if cc.has_header('cairo.h') and cc.has_header ('cairo-gobject.h') + cairo_dep = cc.find_library ('cairo') + cairo_gobject_dep = cc.find_library ('cairo-gobject') + endif + endif if python.language_version().version_compare('>= 3.0') pycairo_name = 'py3cairo' @@ -55,65 +64,68 @@ ) endif -cc = meson.get_compiler('c') +main_c_args = [] +if cc.get_id() == 'msvc' + main_c_args += [ '-FImsvc_recommended_pragmas.h' ] +else + main_c_args += [ + '-Wall', + '-Warray-bounds', + '-Wcast-align', + '-Wdeclaration-after-statement', + '-Wduplicated-branches', + '-Wextra', + '-Wformat=2', + '-Wformat-nonliteral', + '-Wformat-security', + '-Wimplicit-function-declaration', + '-Winit-self', + '-Wjump-misses-init', + '-Wlogical-op', + '-Wmissing-declarations', + '-Wmissing-format-attribute', + '-Wmissing-include-dirs', + '-Wmissing-noreturn', + '-Wmissing-prototypes', + '-Wnested-externs', + '-Wnull-dereference', + '-Wold-style-definition', + '-Wpacked', + '-Wpointer-arith', + '-Wrestrict', + '-Wreturn-type', + '-Wshadow', + '-Wsign-compare', + '-Wstrict-aliasing', + '-Wstrict-prototypes', + '-Wundef', + '-Wunused-but-set-variable', + '-Wwrite-strings', + ] -main_c_args = [ - '-Wall', - '-Warray-bounds', - '-Wcast-align', - '-Wdeclaration-after-statement', - '-Wduplicated-branches', - '-Wextra', - '-Wformat=2', - '-Wformat-nonliteral', - '-Wformat-security', - '-Wimplicit-function-declaration', - '-Winit-self', - '-Wjump-misses-init', - '-Wlogical-op', - '-Wmissing-declarations', - '-Wmissing-format-attribute', - '-Wmissing-include-dirs', - '-Wmissing-noreturn', - '-Wmissing-prototypes', - '-Wnested-externs', - '-Wnull-dereference', - '-Wold-style-definition', - '-Wpacked', - '-Wpointer-arith', - '-Wrestrict', - '-Wreturn-type', - '-Wshadow', - '-Wsign-compare', - '-Wstrict-aliasing', - '-Wstrict-prototypes', - '-Wundef', - '-Wunused-but-set-variable', - '-Wwrite-strings', -] - -main_c_args += [ - '-Wno-incompatible-pointer-types-discards-qualifiers', - '-Wno-missing-field-initializers', - '-Wno-unused-parameter', - '-Wno-discarded-qualifiers', - '-Wno-sign-conversion', - '-Wno-cast-function-type', - '-Wno-int-conversion', -] - -main_c_args += [ - '-fno-strict-aliasing', - '-fvisibility=hidden', -] + main_c_args += [ + '-Wno-incompatible-pointer-types-discards-qualifiers', + '-Wno-missing-field-initializers', + '-Wno-unused-parameter', + '-Wno-discarded-qualifiers', + '-Wno-sign-conversion', + '-Wno-cast-function-type', + '-Wno-int-conversion', + ] -if not ['3.3', '3.4'].contains(python.language_version()) main_c_args += [ - '-Wswitch-default', + '-fno-strict-aliasing', + '-fvisibility=hidden', ] -endif -main_c_args = cc.get_supported_arguments(main_c_args) + 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 pyext_c_args = ['-DPY_SSIZE_T_CLEAN'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/setup.cfg new/pygobject-3.30.4/setup.cfg --- old/pygobject-3.30.1/setup.cfg 2018-09-14 20:55:01.000000000 +0200 +++ new/pygobject-3.30.4/setup.cfg 2018-11-30 21:07:36.000000000 +0100 @@ -1,5 +1,5 @@ [flake8] -ignore = E501,E123,E124,E402,E731,E722 +ignore = E501,E123,E124,E402,E731,E722,W504 exclude = subprojects [coverage:run] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/setup.py new/pygobject-3.30.4/setup.py --- old/pygobject-3.30.1/setup.py 2018-09-14 20:45:24.000000000 +0200 +++ new/pygobject-3.30.4/setup.py 2018-11-30 20:06:41.000000000 +0100 @@ -24,6 +24,8 @@ import tarfile import sysconfig import tempfile +import posixpath + from email import parser try: @@ -39,7 +41,7 @@ from distutils.spawn import find_executable -PYGOBJECT_VERISON = "3.30.1" +PYGOBJECT_VERSION = "3.30.4" GLIB_VERSION_REQUIRED = "2.38.0" GI_VERSION_REQUIRED = "1.46.0" PYCAIRO_VERSION_REQUIRED = "1.11.1" @@ -47,7 +49,7 @@ def is_dev_version(): - version = tuple(map(int, PYGOBJECT_VERISON.split("."))) + version = tuple(map(int, PYGOBJECT_VERSION.split("."))) return version[1] % 2 != 0 @@ -77,7 +79,7 @@ def get_versions(): - version = PYGOBJECT_VERISON.split(".") + version = PYGOBJECT_VERSION.split(".") assert len(version) == 3 versions = { @@ -214,7 +216,7 @@ """ if compiler.compiler_type == "msvc": - # TODO + # TODO, not much of need for now. return [] extra = [] @@ -273,7 +275,7 @@ def run(self): # Don't use PEP 440 pre-release versions for GNOME releases - self.distribution.metadata.version = PYGOBJECT_VERISON + self.distribution.metadata.version = PYGOBJECT_VERSION dist_dir = tempfile.mkdtemp() try: @@ -377,6 +379,7 @@ self.build_temp = None self.build_base = None self.force = False + self.extra_defines = [] def finalize_options(self): self.set_undefined_options( @@ -441,25 +444,45 @@ else: compiler.shared_lib_extension = ".so" + if compiler.compiler_type == "msvc": + g_ir_scanner_cmd = [sys.executable, g_ir_scanner] + else: + g_ir_scanner_cmd = [g_ir_scanner] + def build_ext(ext): - if compiler.compiler_type == "msvc": - raise Exception("MSVC support not implemented") libname = compiler.shared_object_filename(ext.name) ext_paths = [os.path.join(tests_dir, libname)] if os.name == "nt": - implibname = libname + ".a" + if compiler.compiler_type == "msvc": + # MSVC: Get rid of the 'lib' prefix and the .dll + # suffix from libname, and append .lib so + # that we get the right .lib filename to + # pass to g-ir-scanner with --library + implibname = libname[3:libname.rfind(".dll")] + '.lib' + else: + implibname = libname + ".a" ext_paths.append(os.path.join(tests_dir, implibname)) if self._newer_group(ext.sources + ext.depends, *ext_paths): + # MSVC: We need to define _GI_EXTERN explcitly so that + # symbols get exported properly + if compiler.compiler_type == "msvc": + self.extra_defines = [('_GI_EXTERN', + '__declspec(dllexport)extern')] objects = compiler.compile( ext.sources, output_dir=self.build_temp, - include_dirs=ext.include_dirs) + include_dirs=ext.include_dirs, + macros=self.extra_defines) if os.name == "nt": - postargs = ["-Wl,--out-implib=%s" % - os.path.join(tests_dir, implibname)] + if compiler.compiler_type == "msvc": + postargs = ["-implib:%s" % + os.path.join(tests_dir, implibname)] + else: + postargs = ["-Wl,--out-implib=%s" % + os.path.join(tests_dir, implibname)] else: postargs = [] @@ -492,29 +515,35 @@ add_ext_pkg_config_dep(ext, compiler.compiler_type, "gio-2.0") ext_paths = build_ext(ext) - gir_path = os.path.join(tests_dir, "GIMarshallingTests-1.0.gir") - typelib_path = os.path.join( + # We want to always use POSIX-style paths for g-ir-compiler + # because it expects the input .gir file and .typelib file to use + # POSIX-style paths, otherwise it fails + gir_path = posixpath.join( + tests_dir, "GIMarshallingTests-1.0.gir") + typelib_path = posixpath.join( tests_dir, "GIMarshallingTests-1.0.typelib") + gimarshal_g_ir_scanner_cmd = g_ir_scanner_cmd + [ + "--no-libtool", + "--include=Gio-2.0", + "--namespace=GIMarshallingTests", + "--nsversion=1.0", + "--symbol-prefix=gi_marshalling_tests", + "--warn-all", + "--warn-error", + "--library-path=%s" % tests_dir, + "--library=gimarshallingtests", + "--pkg=glib-2.0", + "--pkg=gio-2.0", + "--cflags-begin", + "-I%s" % gi_tests_dir, + "--cflags-end", + "--output=%s" % gir_path, + ] + if self._newer_group(ext_paths, gir_path): - subprocess.check_call([ - g_ir_scanner, - "--no-libtool", - "--include=Gio-2.0", - "--namespace=GIMarshallingTests", - "--nsversion=1.0", - "--symbol-prefix=gi_marshalling_tests", - "--warn-all", - "--warn-error", - "--library-path=%s" % tests_dir, - "--library=gimarshallingtests", - "--pkg=glib-2.0", - "--pkg=gio-2.0", - "--cflags-begin", - "-I%s" % gi_tests_dir, - "--cflags-end", - "--output=%s" % gir_path, - ] + ext.sources + ext.depends) + subprocess.check_call(gimarshal_g_ir_scanner_cmd + + ext.sources + ext.depends) if self._newer_group([gir_path], typelib_path): subprocess.check_call([ @@ -543,27 +572,43 @@ add_ext_pkg_config_dep(ext, compiler.compiler_type, "cairo-gobject") ext_paths = build_ext(ext) - gir_path = os.path.join(tests_dir, "Regress-1.0.gir") - typelib_path = os.path.join(tests_dir, "Regress-1.0.typelib") + # We want to always use POSIX-style paths for g-ir-compiler + # because it expects the input .gir file and .typelib file to use + # POSIX-style paths, otherwise it fails + gir_path = posixpath.join(tests_dir, "Regress-1.0.gir") + typelib_path = posixpath.join(tests_dir, "Regress-1.0.typelib") + regress_g_ir_scanner_cmd = g_ir_scanner_cmd + [ + "--no-libtool", + "--include=cairo-1.0", + "--include=Gio-2.0", + "--namespace=Regress", + "--nsversion=1.0", + "--warn-all", + "--warn-error", + "--library-path=%s" % tests_dir, + "--library=regress", + "--pkg=glib-2.0", + "--pkg=gio-2.0"] if self._newer_group(ext_paths, gir_path): - subprocess.check_call([ - g_ir_scanner, - "--no-libtool", - "--include=cairo-1.0", - "--include=Gio-2.0", - "--namespace=Regress", - "--nsversion=1.0", - "--warn-all", - "--warn-error", - "--library-path=%s" % tests_dir, - "--library=regress", - "--pkg=glib-2.0", - "--pkg=gio-2.0", - "--pkg=cairo", - "--pkg=cairo-gobject", - "--output=%s" % gir_path, - ] + ext.sources + ext.depends) + # MSVC: We don't normally have the pkg-config files for + # cairo and cairo-gobject, so use --extra-library + # instead of --pkg to pass those to the linker, so that + # g-ir-scanner won't fail due to linker errors + if compiler.compiler_type == "msvc": + regress_g_ir_scanner_cmd += [ + "--extra-library=cairo", + "--extra-library=cairo-gobject"] + + else: + regress_g_ir_scanner_cmd += [ + "--pkg=cairo", + "--pkg=cairo-gobject"] + + regress_g_ir_scanner_cmd += ["--output=%s" % gir_path] + + subprocess.check_call(regress_g_ir_scanner_cmd + + ext.sources + ext.depends) if self._newer_group([gir_path], typelib_path): subprocess.check_call([ @@ -878,76 +923,83 @@ def add_ext_compiler_flags(ext, compiler, _cache={}): - cache_key = compiler.compiler[0] - if cache_key not in _cache: + if compiler.compiler_type == "msvc": + # MSVC: Just force-include msvc_recommended_pragmas.h so that + # we can look out for compiler warnings that we really + # want to look out for, and filter out those that don't + # really matter to us. + ext.extra_compile_args += ['-FImsvc_recommended_pragmas.h'] + else: + cache_key = compiler.compiler[0] + if cache_key not in _cache: - args = [ - "-Wall", - "-Warray-bounds", - "-Wcast-align", - "-Wdeclaration-after-statement", - "-Wduplicated-branches", - "-Wextra", - "-Wformat=2", - "-Wformat-nonliteral", - "-Wformat-security", - "-Wimplicit-function-declaration", - "-Winit-self", - "-Wjump-misses-init", - "-Wlogical-op", - "-Wmissing-declarations", - "-Wmissing-format-attribute", - "-Wmissing-include-dirs", - "-Wmissing-noreturn", - "-Wmissing-prototypes", - "-Wnested-externs", - "-Wnull-dereference", - "-Wold-style-definition", - "-Wpacked", - "-Wpointer-arith", - "-Wrestrict", - "-Wreturn-type", - "-Wshadow", - "-Wsign-compare", - "-Wstrict-aliasing", - "-Wstrict-prototypes", - "-Wundef", - "-Wunused-but-set-variable", - "-Wwrite-strings", - ] + args = [ + "-Wall", + "-Warray-bounds", + "-Wcast-align", + "-Wdeclaration-after-statement", + "-Wduplicated-branches", + "-Wextra", + "-Wformat=2", + "-Wformat-nonliteral", + "-Wformat-security", + "-Wimplicit-function-declaration", + "-Winit-self", + "-Wjump-misses-init", + "-Wlogical-op", + "-Wmissing-declarations", + "-Wmissing-format-attribute", + "-Wmissing-include-dirs", + "-Wmissing-noreturn", + "-Wmissing-prototypes", + "-Wnested-externs", + "-Wnull-dereference", + "-Wold-style-definition", + "-Wpacked", + "-Wpointer-arith", + "-Wrestrict", + "-Wreturn-type", + "-Wshadow", + "-Wsign-compare", + "-Wstrict-aliasing", + "-Wstrict-prototypes", + "-Wundef", + "-Wunused-but-set-variable", + "-Wwrite-strings", + ] + + if sys.version_info[:2] != (3, 4): + args += [ + "-Wswitch-default", + ] - if sys.version_info[:2] != (3, 4): args += [ - "-Wswitch-default", + "-Wno-incompatible-pointer-types-discards-qualifiers", + "-Wno-missing-field-initializers", + "-Wno-unused-parameter", + "-Wno-discarded-qualifiers", + "-Wno-sign-conversion", + "-Wno-cast-function-type", + "-Wno-int-conversion", ] - args += [ - "-Wno-incompatible-pointer-types-discards-qualifiers", - "-Wno-missing-field-initializers", - "-Wno-unused-parameter", - "-Wno-discarded-qualifiers", - "-Wno-sign-conversion", - "-Wno-cast-function-type", - "-Wno-int-conversion", - ] - - # silence clang for unused gcc CFLAGS added by Debian - args += [ - "-Wno-unused-command-line-argument", - ] + # silence clang for unused gcc CFLAGS added by Debian + args += [ + "-Wno-unused-command-line-argument", + ] - args += [ - "-fno-strict-aliasing", - "-fvisibility=hidden", - ] + args += [ + "-fno-strict-aliasing", + "-fvisibility=hidden", + ] - # force GCC to use colors - if hasattr(sys.stdout, "isatty") and sys.stdout.isatty(): - args.append("-fdiagnostics-color") + # force GCC to use colors + if hasattr(sys.stdout, "isatty") and sys.stdout.isatty(): + args.append("-fdiagnostics-color") - _cache[cache_key] = filter_compiler_arguments(compiler, args) + _cache[cache_key] = filter_compiler_arguments(compiler, args) - ext.extra_compile_args += _cache[cache_key] + ext.extra_compile_args += _cache[cache_key] du_build_ext = get_command_class("build_ext") @@ -1078,7 +1130,7 @@ "includedir": "${prefix}/include", "datarootdir": "${prefix}/share", "datadir": "${datarootdir}", - "VERSION": PYGOBJECT_VERISON, + "VERSION": PYGOBJECT_VERSION, } for key, value in config.items(): content = content.replace("@%s@" % key, value) @@ -1121,7 +1173,7 @@ gi_ext = Extension( name='gi._gi', - sources=sources, + sources=sorted(sources), include_dirs=[script_dir, gi_dir], depends=list_headers(script_dir) + list_headers(gi_dir), define_macros=[("PY_SSIZE_T_CLEAN", None)], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/tests/test_gdbus.py new/pygobject-3.30.4/tests/test_gdbus.py --- old/pygobject-3.30.1/tests/test_gdbus.py 2018-04-13 21:02:21.000000000 +0200 +++ new/pygobject-3.30.4/tests/test_gdbus.py 2018-11-26 22:31:33.000000000 +0100 @@ -248,3 +248,10 @@ self.assertTrue(isinstance(data['error'], Exception)) self.assertTrue('InvalidArgs' in str(data['error']), str(data['error'])) + + def test_instantiate_custom_proxy(self): + class SomeProxy(Gio.DBusProxy): + def __init__(self): + Gio.DBusProxy.__init__(self) + + SomeProxy() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/tests/test_gio.py new/pygobject-3.30.4/tests/test_gio.py --- old/pygobject-3.30.1/tests/test_gio.py 2018-05-31 17:11:33.000000000 +0200 +++ new/pygobject-3.30.4/tests/test_gio.py 2018-11-25 23:06:50.000000000 +0100 @@ -67,9 +67,9 @@ self.settings.reset('test-enum') def test_iter(self): - assert list(self.settings) == [ + assert set(list(self.settings)) == set([ 'test-tuple', 'test-array', 'test-boolean', 'test-string', - 'test-enum', 'test-range'] + 'test-enum', 'test-range']) def test_get_set(self): for key in self.settings: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/tests/test_overrides_gtk.py new/pygobject-3.30.4/tests/test_overrides_gtk.py --- old/pygobject-3.30.1/tests/test_overrides_gtk.py 2018-05-31 17:11:33.000000000 +0200 +++ new/pygobject-3.30.4/tests/test_overrides_gtk.py 2018-11-30 19:56:56.000000000 +0100 @@ -822,6 +822,30 @@ []), } + def test_add_from_string(self): + builder = Gtk.Builder() + builder.add_from_string(u"") + builder.add_from_string("") + + def get_example(string): + return u"""\ +<interface> + <menu id="appmenu"> + <section> + <item> + <attribute name="label">%s</attribute> + </item> + </section> + </menu> +</interface>""" % string + + builder.add_from_string(get_example(u"ä" * 1000)) + + builder = Gtk.Builder() + builder.add_objects_from_string(u"", ['']) + builder.add_objects_from_string("", ['']) + builder.add_objects_from_string(get_example(u"ä" * 1000), ['']) + def test_extract_handler_and_args_object(self): class Obj(): pass @@ -1572,6 +1596,26 @@ ([0], [-1]), ([0, 0], [0]), ([0, 1], [None]), ([0, 2], [None]), ([0, 3], [4321]), ([0, 4], [1234])] + def test_tree_store_insert_before_none(self): + store = Gtk.TreeStore(object) + root = store.append(None) + sub = store.append(root) + + iter_ = store.insert_before(None, None, [1]) + assert store.get_path(iter_).get_indices() == [1] + + iter_ = store.insert_before(root, None, [1]) + assert store.get_path(iter_).get_indices() == [0, 1] + + iter_ = store.insert_before(sub, None, [1]) + assert store.get_path(iter_).get_indices() == [0, 0, 0] + + iter_ = store.insert_before(None, root, [1]) + assert store.get_path(iter_).get_indices() == [0] + + iter_ = store.insert_before(None, sub, [1]) + assert store.get_path(iter_).get_indices() == [1, 0] + def test_tree_store_insert_after(self): store = Gtk.TreeStore(object) signals = [] @@ -1633,6 +1677,26 @@ ([0], [-1]), ([0, 0], [1234]), ([0, 1], [4321]), ([0, 2], [None]), ([0, 3], [None]), ([0, 4], [0])] + def test_tree_store_insert_after_none(self): + store = Gtk.TreeStore(object) + root = store.append(None) + sub = store.append(root) + + iter_ = store.insert_after(None, None, [1]) + assert store.get_path(iter_).get_indices() == [0] + + iter_ = store.insert_after(root, None, [1]) + assert store.get_path(iter_).get_indices() == [1, 0] + + iter_ = store.insert_after(sub, None, [1]) + assert store.get_path(iter_).get_indices() == [1, 1, 0] + + iter_ = store.insert_after(None, root, [1]) + assert store.get_path(iter_).get_indices() == [2] + + iter_ = store.insert_after(None, sub, [1]) + assert store.get_path(iter_).get_indices() == [1, 2] + def test_tree_path(self): p1 = Gtk.TreePath() p2 = Gtk.TreePath.new_first() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygobject-3.30.1/tests/test_repository.py new/pygobject-3.30.4/tests/test_repository.py --- old/pygobject-3.30.1/tests/test_repository.py 2018-05-31 17:11:33.000000000 +0200 +++ new/pygobject-3.30.4/tests/test_repository.py 2018-11-30 20:18:02.000000000 +0100 @@ -23,7 +23,10 @@ from __future__ import absolute_import import unittest -import collections +try: + from collections import abc +except ImportError: + import collections as abc import gi._gi as GIRepository from gi.module import repository as repo @@ -113,12 +116,12 @@ def test_object_info(self): info = repo.find_by_name('GIMarshallingTests', 'Object') self.assertEqual(info.get_parent(), repo.find_by_name('GObject', 'Object')) - self.assertTrue(isinstance(info.get_methods(), collections.Iterable)) - self.assertTrue(isinstance(info.get_fields(), collections.Iterable)) - self.assertTrue(isinstance(info.get_interfaces(), collections.Iterable)) - self.assertTrue(isinstance(info.get_constants(), collections.Iterable)) - self.assertTrue(isinstance(info.get_vfuncs(), collections.Iterable)) - self.assertTrue(isinstance(info.get_properties(), collections.Iterable)) + self.assertTrue(isinstance(info.get_methods(), abc.Iterable)) + self.assertTrue(isinstance(info.get_fields(), abc.Iterable)) + self.assertTrue(isinstance(info.get_interfaces(), abc.Iterable)) + self.assertTrue(isinstance(info.get_constants(), abc.Iterable)) + self.assertTrue(isinstance(info.get_vfuncs(), abc.Iterable)) + self.assertTrue(isinstance(info.get_properties(), abc.Iterable)) self.assertFalse(info.get_abstract()) self.assertEqual(info.get_class_struct(), repo.find_by_name('GIMarshallingTests', 'ObjectClass')) self.assertEqual(info.get_type_name(), 'GIMarshallingTestsObject') @@ -158,12 +161,12 @@ def test_interface_info(self): info = repo.find_by_name('GIMarshallingTests', 'Interface') - self.assertTrue(isinstance(info.get_methods(), collections.Iterable)) - self.assertTrue(isinstance(info.get_vfuncs(), collections.Iterable)) - self.assertTrue(isinstance(info.get_constants(), collections.Iterable)) - self.assertTrue(isinstance(info.get_prerequisites(), collections.Iterable)) - self.assertTrue(isinstance(info.get_properties(), collections.Iterable)) - self.assertTrue(isinstance(info.get_signals(), collections.Iterable)) + self.assertTrue(isinstance(info.get_methods(), abc.Iterable)) + self.assertTrue(isinstance(info.get_vfuncs(), abc.Iterable)) + self.assertTrue(isinstance(info.get_constants(), abc.Iterable)) + self.assertTrue(isinstance(info.get_prerequisites(), abc.Iterable)) + self.assertTrue(isinstance(info.get_properties(), abc.Iterable)) + self.assertTrue(isinstance(info.get_signals(), abc.Iterable)) method = info.find_method('test_int8_in') vfunc = info.find_vfunc('test_int8_in') @@ -179,8 +182,8 @@ def test_struct_info(self): info = repo.find_by_name('GIMarshallingTests', 'InterfaceIface') self.assertTrue(isinstance(info, GIRepository.StructInfo)) - self.assertTrue(isinstance(info.get_fields(), collections.Iterable)) - self.assertTrue(isinstance(info.get_methods(), collections.Iterable)) + self.assertTrue(isinstance(info.get_fields(), abc.Iterable)) + self.assertTrue(isinstance(info.get_methods(), abc.Iterable)) self.assertTrue(isinstance(info.get_size(), int)) self.assertTrue(isinstance(info.get_alignment(), int)) self.assertTrue(info.is_gtype_struct()) @@ -189,16 +192,16 @@ def test_enum_info(self): info = repo.find_by_name('GIMarshallingTests', 'Enum') self.assertTrue(isinstance(info, GIRepository.EnumInfo)) - self.assertTrue(isinstance(info.get_values(), collections.Iterable)) - self.assertTrue(isinstance(info.get_methods(), collections.Iterable)) + self.assertTrue(isinstance(info.get_values(), abc.Iterable)) + self.assertTrue(isinstance(info.get_methods(), abc.Iterable)) self.assertFalse(info.is_flags()) self.assertTrue(info.get_storage_type() > 0) # might be platform dependent def test_union_info(self): info = repo.find_by_name('GIMarshallingTests', 'Union') self.assertTrue(isinstance(info, GIRepository.UnionInfo)) - self.assertTrue(isinstance(info.get_fields(), collections.Iterable)) - self.assertTrue(isinstance(info.get_methods(), collections.Iterable)) + self.assertTrue(isinstance(info.get_fields(), abc.Iterable)) + self.assertTrue(isinstance(info.get_methods(), abc.Iterable)) self.assertTrue(isinstance(info.get_size(), int)) def test_type_info(self): @@ -245,7 +248,7 @@ def test_callable_info(self): func_info = repo.find_by_name('GIMarshallingTests', 'array_fixed_out_struct') self.assertTrue(hasattr(func_info, 'invoke')) - self.assertTrue(isinstance(func_info.get_arguments(), collections.Iterable)) + self.assertTrue(isinstance(func_info.get_arguments(), abc.Iterable)) self.assertEqual(func_info.get_caller_owns(), GIRepository.Transfer.NOTHING) self.assertFalse(func_info.may_return_null()) self.assertEqual(func_info.get_return_type().get_tag(), GIRepository.TypeTag.VOID)