Projects
openEuler:Mainline
pygobject3
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
_service:tar_scm:pygobject3.spec
Changed
@@ -1,6 +1,6 @@ Name: pygobject3 -Version: 3.42.1 -Release: 2 +Version: 3.42.2 +Release: 1 Summary: Provides bindings for GObject based libraries License: LGPLv2+ and MIT URL: https://wiki.gnome.org/Projects/PyGObject @@ -87,6 +87,12 @@ %{_libdir}/pkgconfig/pygobject-3.0.pc %changelog +* Thu Nov 17 2022 fuanan <fuanan3@h-partners.com> - 3.42.2-1 +- update version to 3.42.2 + +* Tue Oct 25 2022 zhuofeng <zhuofeng2@huawei.com> - 3.42.1-3 +- Rebuild for next release + * Tue Jun 28 2022 jiangxinyu <jiangxinyu@kylinos.cn> - 3.42.1-2 - Add provides for python3-gobject-base
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="scm">git</param> <param name="url">git@gitee.com:src-openeuler/pygobject3.git</param> - <param name="revision">907bd24ce954f47d14d674bfd00b63b85b15c305</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/.gitlab-ci.yml -> _service:tar_scm:pygobject-3.42.2.tar.xz/.gitlab-ci.yml
Changed
@@ -82,6 +82,11 @@ PYENV_VERSION: "3.9.0-debug" <<: *defaults +python3.10: + variables: + PYENV_VERSION: "3.10.5-debug" + <<: *defaults + pypy3.6: allow_failure: true variables:
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/.gitlab-ci/Dockerfile -> _service:tar_scm:pygobject-3.42.2.tar.xz/.gitlab-ci/Dockerfile
Changed
@@ -46,5 +46,6 @@ RUN pyenv install --debug 3.7.9 RUN pyenv install --debug 3.8.5 RUN pyenv install --debug 3.9.0 +RUN pyenv install --debug 3.10.5 ENV PATH="/usr/lib/ccache:${PATH}"
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/NEWS -> _service:tar_scm:pygobject-3.42.2.tar.xz/NEWS
Changed
@@ -1,3 +1,17 @@ +3.42.2 - 2022-07-16 +------------------- + +* Error out instead of crashing when marshaling unsupported fundamental types in some cases :mr:`180` +* Add a workaround for a PyPy 3.9+ bug when threads are used :mr:`200` +* Fix crashes when marshaling zero terminated arrays for certain item types :mr:`191` +* Fix a crash/refcounting error in case marshaling a hash table fails :mr:`191` +* Make the test suite pass again with PyPy :mr:`191` +* tests: support running tests with (MSVC) CPython 3.8+ on Windows :mr:`206` +* interface: Fix leak when overriding GInterfaceInfo :mr:`204` +* setup.py: look up pycairo headers without importing the module + (helps with building on Windows and MSVC CPython 3.8+) :mr:`205` + + 3.42.1 - 2022-04-17 -------------------
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/PKG-INFO -> _service:tar_scm:pygobject-3.42.2.tar.xz/PKG-INFO
Changed
@@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: PyGObject -Version: 3.42.1 +Version: 3.42.2 Summary: Python bindings for GObject Introspection Home-page: https://pygobject.readthedocs.io Author: James Henstridge
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/PyGObject.egg-info/PKG-INFO -> _service:tar_scm:pygobject-3.42.2.tar.xz/PyGObject.egg-info/PKG-INFO
Changed
@@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: PyGObject -Version: 3.42.1 +Version: 3.42.2 Summary: Python bindings for GObject Introspection Home-page: https://pygobject.readthedocs.io Author: James Henstridge
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/PyGObject.egg-info/SOURCES.txt -> _service:tar_scm:pygobject-3.42.2.tar.xz/PyGObject.egg-info/SOURCES.txt
Changed
@@ -290,6 +290,7 @@ tests/test_gobject.py tests/test_gtk_template.py tests/test_gtype.py +tests/test_gtype_instance.py tests/test_import_machinery.py tests/test_interface.py tests/test_internal_api.py
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/gi/gimodule.c -> _service:tar_scm:pygobject-3.42.2.tar.xz/gi/gimodule.c
Changed
@@ -1066,11 +1066,15 @@ pygobject__g_instance_init(GTypeInstance *instance, gpointer g_class) { - GObject *object = (GObject *) instance; + GObject *object; PyObject *wrapper, *result; PyGILState_STATE state; gboolean needs_init = FALSE; + g_return_if_fail(G_IS_OBJECT(instance)); + + object = (GObject *) instance; + wrapper = g_object_get_qdata(object, pygobject_wrapper_key); if (wrapper == NULL) { wrapper = pygobject_init_wrapper_get(); @@ -1738,6 +1742,7 @@ info->interface_init = (GInterfaceInitFunc) initialize_interface; pyg_register_interface_info (g_type, info); + g_free (info); Py_RETURN_NONE; } @@ -2522,8 +2527,9 @@ module = PyModule_Create(&__gimodule); PyObject *module_dict = PyModule_GetDict (module); -#if PY_VERSION_HEX < 0x03090000 +#if PY_VERSION_HEX < 0x03090000 || defined(PYPY_VERSION) /* Deprecated since 3.9 */ + /* Except in PyPy it's still not a no-op: https://foss.heptapod.net/pypy/pypy/-/issues/3691 */ /* Always enable Python threads since we cannot predict which GI repositories * might accept Python callbacks run within non-Python threads or might trigger
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/gi/pygi-argument.c -> _service:tar_scm:pygobject-3.42.2.tar.xz/gi/pygi-argument.c
Changed
@@ -269,7 +269,16 @@ g_base_info_unref ( (GIBaseInfo *) item_type_info); if (is_zero_terminated) { - length = g_strv_length (arg->v_pointer); + if (item_size == sizeof(gpointer)) + length = g_strv_length ((gchar **)arg->v_pointer); + else if (item_size == 1) + length = strlen ((gchar*)arg->v_pointer); + else if (item_size == sizeof(int)) + for (length = 0; *(((int*)arg->v_pointer) + length); length++); + else if (item_size == sizeof(short)) + for (length = 0; *(((short*)arg->v_pointer) + length); length++); + else + g_assert_not_reached (); } else { length = g_type_info_get_array_fixed_size (type_info); if (length < 0) {
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/gi/pygi-array.c -> _service:tar_scm:pygobject-3.42.2.tar.xz/gi/pygi-array.c
Changed
@@ -545,10 +545,16 @@ } else if (array_cache->is_zero_terminated) { if (arg->v_pointer == NULL) { len = 0; - } else if (seq_cache->item_cache->type_tag == GI_TYPE_TAG_UINT8) { + } else if (array_cache->item_size == 1) { len = strlen (arg->v_pointer); - } else { + } else if (array_cache->item_size == sizeof(gpointer)) { len = g_strv_length ((gchar **)arg->v_pointer); + } else if (array_cache->item_size == sizeof(int)) { + for (len = 0; *(((int*)arg->v_pointer) + len); len++); + } else if (array_cache->item_size == sizeof(short)) { + for (len = 0; *(((short*)arg->v_pointer) + len); len++); + } else { + g_assert_not_reached (); } } else { GIArgument *len_arg = &state->argsarray_cache->len_arg_index.arg_value; @@ -717,7 +723,16 @@ if (array_cache->fixed_size >= 0) { len = array_cache->fixed_size; } else if (array_cache->is_zero_terminated) { - len = g_strv_length ((gchar **)data); + if (array_cache->item_size == sizeof(gpointer)) + len = g_strv_length ((gchar **)data); + else if (array_cache->item_size == 1) + len = strlen ((gchar*)data); + else if (array_cache->item_size == sizeof(int)) + for (len = 0; *(((int*)data) + len); len++); + else if (array_cache->item_size == sizeof(short)) + for (len = 0; *(((short*)data) + len); len++); + else + g_assert_not_reached (); } else if (array_cache->len_arg_index >= 0) { GIArgument *len_arg = &state->argsarray_cache->len_arg_index.arg_value; len = len_arg->v_long;
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/gi/pygi-hashtable.c -> _service:tar_scm:pygobject-3.42.2.tar.xz/gi/pygi-hashtable.c
Changed
@@ -139,8 +139,6 @@ continue; err: /* FIXME: cleanup hash keys and values */ - Py_XDECREF (py_key); - Py_XDECREF (py_value); Py_DECREF (py_keys); Py_DECREF (py_values); g_hash_table_unref (hash_);
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/gi/pygi-object.c -> _service:tar_scm:pygobject-3.42.2.tar.xz/gi/pygi-object.c
Changed
@@ -235,10 +235,15 @@ if (transfer == GI_TRANSFER_EVERYTHING) g_param_spec_unref (arg->v_pointer); - } else { + } else if (G_IS_OBJECT(arg->v_pointer)) { pyobj = pygobject_new_full (arg->v_pointer, /*steal=*/ transfer == GI_TRANSFER_EVERYTHING, /*type=*/ NULL); + } else { + PyErr_Format(PyExc_TypeError, + "No means to translate argument or return value for '%s'", + g_type_name_from_instance(arg->v_pointer)); + return NULL; } return pyobj; @@ -261,7 +266,7 @@ */ if (arg->v_pointer != NULL && transfer == GI_TRANSFER_NOTHING && - !G_IS_PARAM_SPEC (arg->v_pointer) && + G_IS_OBJECT (arg->v_pointer) && g_object_is_floating (arg->v_pointer)) { g_object_ref (arg->v_pointer);
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/gi/pyginterface.c -> _service:tar_scm:pygobject-3.42.2.tar.xz/gi/pyginterface.c
Changed
@@ -85,15 +85,21 @@ } g_type_set_qdata(gtype, pyginterface_type_key, type); - + PyDict_SetItemString(dict, (char *)class_name, (PyObject *)type); - + } void pyg_register_interface_info(GType gtype, const GInterfaceInfo *info) { - g_type_set_qdata(gtype, pyginterface_info_key, (gpointer) info); + GInterfaceInfo *prev_info = pyg_lookup_interface_info (gtype); + + if (prev_info) { + g_free (prev_info); + } + + g_type_set_qdata(gtype, pyginterface_info_key, g_memdup2 (info, sizeof(GInterfaceInfo))); } const GInterfaceInfo *
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/meson.build -> _service:tar_scm:pygobject-3.42.2.tar.xz/meson.build
Changed
@@ -1,5 +1,5 @@ project('pygobject', 'c', - version : '3.42.1', + version : '3.42.2', meson_version : '>= 0.47.0', default_options : 'warning_level=1', 'buildtype=debugoptimized') @@ -136,6 +136,10 @@ cdata.set('PYGOBJECT_MINOR_VERSION', pygobject_version_minor) cdata.set('PYGOBJECT_MICRO_VERSION', pygobject_version_micro) +if gio_dep.version().version_compare('< 2.67.4') + cdata.set('g_memdup2(ptr,sz)', '(G_LIKELY(((guint64)(sz)) < G_MAXUINT)) ? g_memdup(ptr,sz) : (g_abort(),NULL)') +endif + configure_file(output : 'config.h', configuration : cdata) pkgconf = configuration_data()
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/pyproject.toml -> _service:tar_scm:pygobject-3.42.2.tar.xz/pyproject.toml
Changed
@@ -1,6 +1,6 @@ tool.poetry name = "PyGObject" -version = "3.42.1" +version = "3.42.2" description = "Python bindings for GObject Introspection" authors = "Christoph Reiter"
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/setup.py -> _service:tar_scm:pygobject-3.42.2.tar.xz/setup.py
Changed
@@ -22,7 +22,6 @@ import errno import subprocess import tarfile -import sysconfig import tempfile import posixpath @@ -37,7 +36,7 @@ from distutils.spawn import find_executable -PYGOBJECT_VERSION = "3.42.1" +PYGOBJECT_VERSION = "3.42.2" GLIB_VERSION_REQUIRED = "2.56.0" GI_VERSION_REQUIRED = "1.56.0" PYCAIRO_VERSION_REQUIRED = "1.16.0" @@ -827,7 +826,9 @@ pkg_config_name = "py3cairo" min_version = get_version_requirement(pkg_config_name) - min_version_info = tuple(int(p) for p in min_version.split(".")) + + def parse_version(string): + return tuple(int(p) for p in string.split(".")) def check_path(include_dir): log.info("pycairo: trying include directory: %r" % include_dir) @@ -843,61 +844,44 @@ if check_path(p): return p - def find_new_api(): - log.info("pycairo: new API") - import cairo - - if cairo.version_info < min_version_info: - raise DistutilsSetupError( - "pycairo >= %s required, %s found." % ( - min_version, ".".join(map(str, cairo.version_info)))) - - if hasattr(cairo, "get_include"): - return cairo.get_include() - log.info("pycairo: no get_include()") - return - - def find_old_api(): - log.info("pycairo: old API") - - import cairo + def find_python(): + """This tries to find the pycairo module without importing it""" - if cairo.version_info < min_version_info: - raise DistutilsSetupError( - "pycairo >= %s required, %s found." % ( - min_version, ".".join(map(str, cairo.version_info)))) + from importlib.util import find_spec - location = os.path.dirname(os.path.abspath(cairo.__path__0)) - log.info("pycairo: found %r" % location) + # Find the module path + spec = find_spec("cairo") + if spec is None: + log.info("pycairo: cairo module not found via importlib") + return + package_path = os.path.dirname(spec.origin) - def get_sys_path(location, name): - # Returns the sysconfig path for a distribution, or None - for scheme in sysconfig.get_scheme_names(): - for path_type in "platlib", "purelib": - path = sysconfig.get_path(path_type, scheme) - try: - if os.path.samefile(path, location): - return sysconfig.get_path(name, scheme) - except EnvironmentError: - pass + # With Python 3.8 we can also check the package version + try: + from importlib.metadata import distribution, PackageNotFoundError + except ImportError: + # Python <3.8 + pass + else: + try: + d = distribution("pycairo") + except PackageNotFoundError: + log.info("pycairo: pycairo distribution not found via importlib") + else: + if parse_version(d.version) < parse_version(min_version): + raise DistutilsSetupError( + "pycairo >= %s required, %s found (%s)." % ( + min_version, d.version, package_path)) - data_path = get_sys_path(location, "data") or sys.prefix - return os.path.join(data_path, "include", "pycairo") + return os.path.join(package_path, 'include') def find_pkg_config(): log.info("pycairo: pkg-config") pkg_config_version_check(pkg_config_name, min_version) return pkg_config_parse("--cflags-only-I", pkg_config_name) - # First the new get_include() API added in >1.15.6 - include_dir = find_path(find_new_api()) - if include_dir is not None: - return include_dir - - # Then try to find it in the data prefix based on the module path. - # This works with many virtualenv/userdir setups, but not all apparently, - # see https://gitlab.gnome.org/GNOME/pygobject/issues/150 - include_dir = find_path(find_old_api()) + # First look in the current Python installation/venv + include_dir = find_path(find_python()) if include_dir is not None: return include_dir @@ -1034,6 +1018,11 @@ /* Configuration header created by setup.py - do not edit */ #ifndef _CONFIG_H #define _CONFIG_H 1 +#include <glib.h> + +#if !GLIB_CHECK_VERSION(2, 67, 4) +#define g_memdup2(ptr,sz) (G_LIKELY(((guint64)(sz)) < G_MAXUINT)) ? g_memdup(ptr,sz) : (g_abort(),NULL) +#endif #define PYGOBJECT_MAJOR_VERSION %(PYGOBJECT_MAJOR_VERSION)s #define PYGOBJECT_MINOR_VERSION %(PYGOBJECT_MINOR_VERSION)s
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/subprojects/gobject-introspection.wrap -> _service:tar_scm:pygobject-3.42.2.tar.xz/subprojects/gobject-introspection.wrap
Changed
@@ -2,5 +2,5 @@ directory=gobject-introspection url=https://gitlab.gnome.org/GNOME/gobject-introspection.git push-url=git@gitlab.gnome.org:GNOME/gobject-introspection.git -revision=master +revision=main depth=1
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/tests/__init__.py -> _service:tar_scm:pygobject-3.42.2.tar.xz/tests/__init__.py
Changed
@@ -6,8 +6,24 @@ import warnings +def set_dll_search_path(): + # Python 3.8 no longer searches for DLLs in PATH, so we have to add + # everything in PATH manually. Note that unlike PATH add_dll_directory + # has no defined order, so if there are two cairo DLLs in PATH we + # might get a random one. + if os.name != "nt" or not hasattr(os, "add_dll_directory"): + return + for p in os.environ.get("PATH", "").split(os.pathsep): + try: + os.add_dll_directory(p) + except OSError: + pass + + def init_test_environ(): + set_dll_search_path() + def dbus_launch_session(): if os.name == "nt" or sys.platform == "darwin": return (-1, "")
View file
_service:tar_scm:pygobject-3.42.1.tar.xz/tests/test_gi.py -> _service:tar_scm:pygobject-3.42.2.tar.xz/tests/test_gi.py
Changed
@@ -920,7 +920,6 @@ result = list(CONSTANT_UCS4) assert GIMarshallingTests.array_unichar_out() == result - @unittest.skip("broken") def test_array_zero_terminated_return_unichar(self): assert GIMarshallingTests.array_zero_terminated_return_unichar() == \ list(CONSTANT_UCS4) @@ -1601,7 +1600,6 @@ gc.collect() assert obj.__grefcount__ == grefcount - @unittest.skipIf(platform.python_implementation() == "PyPy", "fixme") def test_gvalue_gobject_ref_counts(self): # Tests a GObject held by a GValue obj = GObject.Object()
View file
_service:tar_scm:pygobject-3.42.2.tar.xz/tests/test_gtype_instance.py
Added
@@ -0,0 +1,8 @@ + +import pytest +from gi.repository import Regress + + +def test_fundamental_type_instantiation_fails(): + with pytest.raises(TypeError, match="No means to translate argument or return value for 'RegressTestFundamentalSubObject'"): + Regress.TestFundamentalSubObject.new("data")
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2