-image: registry.gitlab.gnome.org/gnome/pygobject/main:v10
+image: registry.gitlab.gnome.org/gnome/pygobject/main:v11
stages:
- build_and_test
python2.7:
variables:
- PYENV_VERSION: "2.7.15-debug"
+ PYENV_VERSION: "2.7.16-debug"
<<: *defaults
python3.5:
variables:
- PYENV_VERSION: "3.5.6"
+ PYENV_VERSION: "3.5.7"
<<: *defaults
python3.6:
python3.7:
variables:
- PYENV_VERSION: "3.7.2-debug"
+ PYENV_VERSION: "3.7.3-debug"
<<: *defaults
-pypy2.7:
- allow_failure: true
+python3.8:
variables:
- PYENV_VERSION: "pypy2.7-7.0.0"
+ PYENV_VERSION: "3.8-dev-debug"
<<: *defaults
-pypy3.5:
+pypy2.7:
allow_failure: true
variables:
- PYENV_VERSION: "pypy3.5-7.0.0"
+ PYENV_VERSION: "pypy2.7-7.1.0"
<<: *defaults
pypy3.6:
allow_failure: true
variables:
- PYENV_VERSION: "pypy3.6-7.0.0"
+ PYENV_VERSION: "pypy3.6-7.1.0"
<<: *defaults
xenial-i386-py2:
gtk4:
stage: build_and_test
- image: registry.gitlab.gnome.org/gnome/pygobject/gtk4:v3
+ image: registry.gitlab.gnome.org/gnome/pygobject/gtk4:v4
artifacts:
paths:
- coverage/
RUN curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
-RUN pyenv install pypy2.7-7.0.0
-RUN pyenv install pypy3.5-7.0.0
-RUN pyenv install pypy3.6-7.0.0
-RUN pyenv install --debug 2.7.15
-RUN pyenv install 3.5.6
+RUN pyenv install pypy2.7-7.1.0
+RUN pyenv install pypy3.6-7.1.0
+RUN pyenv install --debug 2.7.16
+RUN pyenv install 3.5.7
RUN pyenv install 3.6.8
-RUN pyenv install --debug 3.7.2
+RUN pyenv install --debug 3.7.3
+RUN pyenv install --debug 3.8-dev
ENV PATH="/usr/lib/ccache:${PATH}"
-FROM registry.gitlab.gnome.org/gnome/pygobject/main:v10
+FROM registry.gitlab.gnome.org/gnome/pygobject/main:v11
USER root
&& rm -Rf gtk
USER user
-ENV PYENV_VERSION 3.7.2-debug
+ENV PYENV_VERSION 3.7.3-debug
set -e
-TAG="registry.gitlab.gnome.org/gnome/pygobject/gtk4:v3"
+TAG="registry.gitlab.gnome.org/gnome/pygobject/gtk4:v4"
sudo docker build --tag "${TAG}" --file "Dockerfile.gtk4" .
sudo docker run --rm --security-opt label=disable \
--- /dev/null
+#!/bin/bash
+
+set -e
+
+TAG="registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master"
+
+sudo docker pull "${TAG}"
+sudo docker run --privileged --rm --security-opt label=disable \
+ --volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
+ --tty --interactive "${TAG}" xvfb-run -a flatpak run --filesystem=host \
+ --share=network --socket=x11 --command=bash org.gnome.Sdk//master
set -e
-TAG="registry.gitlab.gnome.org/gnome/pygobject/main:v10"
+TAG="registry.gitlab.gnome.org/gnome/pygobject/main:v11"
sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
--file "Dockerfile" .
-sudo docker run -e PYENV_VERSION='3.7.2-debug' --rm --security-opt label=disable \
+sudo docker run -e PYENV_VERSION='3.7.3-debug' --rm --security-opt label=disable \
--volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
--tty --interactive "${TAG}" bash
set -e
+python3 -m pip install --user pytest pytest-faulthandler
+# for some reason pip3 fails the first time now..
+# https://gitlab.com/freedesktop-sdk/freedesktop-sdk/issues/776
python3 -m pip install --user pytest pytest-faulthandler
python3 setup.py test -s
+3.33.1 - 2019-08-18
+-------------------
+
+* Make GLib.Variant.unpack a bit less costly :mr:`121` (:user:`Mathieu Bridon <mbridon>`)
+* pygobject: ignore GParameter deprecations :mr:`122` (:user:`Christian Hergert <chergert>`)
+* pygobject-object: fix refcount of floating return values :mr:`120` (:user:`Mathieu Duponchelle <mathieudu>`)
+* pygi-info: remove some dead code :issue:`303`
+
+
3.32.2 - 2019-06-23
-------------------
* setup.py: specify python_requires
+3.30.5 - 2019-06-16
+-------------------
+
+* tests/gimarshallingtestsextra.c/h: relicense to LGPLv2.1+ :issue:`320`
+* Fix a crash when marshalling a GError to Python fails :mr:`115`
+* Fix leak of transfer-full/container C arrays :mr:`117` (:user:`Tomasz Miąsko <tmiasko>`)
+* Python 3.8b1 compatibility fixes
+
+
3.32.1 - 2019-04-20
-------------------
#) Go to http://www.msys2.org/ and download the x86_64 installer
#) Follow the instructions on the page for setting up the basic environment
-#) Run ``C:\msys64\mingw32.exe`` - a terminal window should pop up
+#) Run ``C:\msys64\mingw64.exe`` - a terminal window should pop up
#) Execute ``pacman -Suy``
-#) Execute ``pacman -S mingw-w64-i686-gtk3 mingw-w64-i686-python3-gobject``
+#) Execute ``pacman -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-gobject``
#) To test that GTK 3 is working you can run ``gtk3-demo``
#) Copy the ``hello.py`` script you created to ``C:\msys64\home\<username>``
#) In the mingw32 terminal execute ``python3 hello.py`` - a window should appear.
if (PyGIWarning == NULL)
return PYGLIB_MODULE_ERROR_RETURN;
- /* Use RuntimeWarning as the base class of PyGIDeprecationWarning
- * for unstable (odd minor version) and use DeprecationWarning for
- * stable (even minor version). This is so PyGObject deprecations
- * behave the same as regular Python deprecations in stable releases.
- */
-#if PYGOBJECT_MINOR_VERSION % 2
- PyGIDeprecationWarning = PyErr_NewException("gi.PyGIDeprecationWarning",
- PyExc_RuntimeWarning, NULL);
-#else
PyGIDeprecationWarning = PyErr_NewException("gi.PyGIDeprecationWarning",
PyExc_DeprecationWarning, NULL);
-#endif
/* Place holder object used to fill in "from Python" argument lists
* for values not supplied by the caller but support a GI default.
return builder.end()
+LEAF_ACCESSORS = {
+ 'b': 'get_boolean',
+ 'y': 'get_byte',
+ 'n': 'get_int16',
+ 'q': 'get_uint16',
+ 'i': 'get_int32',
+ 'u': 'get_uint32',
+ 'x': 'get_int64',
+ 't': 'get_uint64',
+ 'h': 'get_handle',
+ 'd': 'get_double',
+ 's': 'get_string',
+ 'o': 'get_string', # object path
+ 'g': 'get_string', # signature
+}
+
+
class Variant(GLib.Variant):
def __new__(cls, format_string, value):
"""Create a GVariant from a native Python object.
def unpack(self):
"""Decompose a GVariant into a native Python object."""
- LEAF_ACCESSORS = {
- 'b': self.get_boolean,
- 'y': self.get_byte,
- 'n': self.get_int16,
- 'q': self.get_uint16,
- 'i': self.get_int32,
- 'u': self.get_uint32,
- 'x': self.get_int64,
- 't': self.get_uint64,
- 'h': self.get_handle,
- 'd': self.get_double,
- 's': self.get_string,
- 'o': self.get_string, # object path
- 'g': self.get_string, # signature
- }
+ type_string = self.get_type_string()
# simple values
- la = LEAF_ACCESSORS.get(self.get_type_string())
+ la = LEAF_ACCESSORS.get(type_string)
if la:
- return la()
+ return getattr(self, la)()
# tuple
- if self.get_type_string().startswith('('):
- res = [self.get_child_value(i).unpack()
- for i in range(self.n_children())]
- return tuple(res)
+ if type_string.startswith('('):
+ return tuple(self.get_child_value(i).unpack()
+ for i in range(self.n_children()))
# dictionary
- if self.get_type_string().startswith('a{'):
+ if type_string.startswith('a{'):
res = {}
for i in range(self.n_children()):
v = self.get_child_value(i)
return res
# array
- if self.get_type_string().startswith('a'):
+ if type_string.startswith('a'):
return [self.get_child_value(i).unpack()
for i in range(self.n_children())]
# variant (just unbox transparently)
- if self.get_type_string().startswith('v'):
+ if type_string.startswith('v'):
return self.get_variant().unpack()
# maybe
- if self.get_type_string().startswith('m'):
+ if type_string.startswith('m'):
if not self.n_children():
return None
return self.get_child_value(0).unpack()
- raise NotImplementedError('unsupported GVariant type ' + self.get_type_string())
+ raise NotImplementedError('unsupported GVariant type ' + type_string)
@classmethod
def split_signature(klass, signature):
static gint
_pygi_g_registered_type_info_check_object (GIRegisteredTypeInfo *info,
- gboolean is_instance,
PyObject *object)
{
gint retval;
g_assert (PyType_Check (py_type));
- if (is_instance) {
- retval = PyObject_IsInstance (object, py_type);
- if (!retval) {
- type_name_expected = _pygi_g_base_info_get_fullname (
- (GIBaseInfo *) info);
- }
- } else {
- if (!PyObject_Type (py_type)) {
- type_name_expected = "type";
- retval = 0;
- } else if (!PyType_IsSubtype ( (PyTypeObject *) object,
- (PyTypeObject *) py_type)) {
- type_name_expected = _pygi_g_base_info_get_fullname (
- (GIBaseInfo *) info);
- retval = 0;
- } else {
- retval = 1;
- }
+ retval = PyObject_IsInstance (object, py_type);
+ if (!retval) {
+ type_name_expected = _pygi_g_base_info_get_fullname (
+ (GIBaseInfo *) info);
}
Py_DECREF (py_type);
g_assert (container_info != NULL);
/* Check the instance. */
- if (!_pygi_g_registered_type_info_check_object ( (GIRegisteredTypeInfo *) container_info, TRUE, instance)) {
+ if (!_pygi_g_registered_type_info_check_object ( (GIRegisteredTypeInfo *) container_info, instance)) {
_PyGI_ERROR_PREFIX ("argument 1: ");
return NULL;
}
g_assert (container_info != NULL);
/* Check the instance. */
- if (!_pygi_g_registered_type_info_check_object ( (GIRegisteredTypeInfo *) container_info, TRUE, instance)) {
+ if (!_pygi_g_registered_type_info_check_object ( (GIRegisteredTypeInfo *) container_info, instance)) {
_PyGI_ERROR_PREFIX ("argument 1: ");
return NULL;
}
g_free(params);
if ((query.return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE) != G_TYPE_NONE) {
+ gboolean was_floating = FALSE;
+
+ if (G_VALUE_HOLDS_OBJECT (&ret)) {
+ GObject *obj = g_value_get_object (&ret);
+ was_floating = g_object_is_floating (obj);
+ }
py_ret = pyg_value_as_pyobject(&ret, TRUE);
- g_value_unset(&ret);
+ if (!was_floating)
+ g_value_unset(&ret);
} else {
Py_INCREF(Py_None);
py_ret = Py_None;
PyObject *(* paramspec_new)(GParamSpec *spec);
GParamSpec *(*paramspec_get)(PyObject *tuple);
int (*pyobj_to_unichar_conv)(PyObject *pyobj, void* ptr);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gboolean (*parse_constructor_args)(GType obj_type,
char **arg_names,
char **prop_names,
GParameter *params,
guint *nparams,
PyObject **py_args);
+G_GNUC_END_IGNORE_DEPRECATIONS
PyObject *(* param_gvalue_as_pyobject) (const GValue* gvalue,
gboolean copy_boxed,
const GParamSpec* pspec);
project('pygobject', 'c',
- version : '3.32.2',
+ version : '3.33.1',
meson_version : '>= 0.46.0',
default_options : [ 'warning_level=1',
'buildtype=debugoptimized'])
from distutils.spawn import find_executable
-PYGOBJECT_VERSION = "3.32.2"
+PYGOBJECT_VERSION = "3.33.1"
GLIB_VERSION_REQUIRED = "2.48.0"
GI_VERSION_REQUIRED = "1.46.0"
PYCAIRO_VERSION_REQUIRED = "1.11.1"
}
#endif
+
+G_DEFINE_TYPE (RegressTestAction, regress_test_action, G_TYPE_INITIALLY_UNOWNED)
+
+enum
+{
+ SIGNAL_0,
+ ACTION_SIGNAL,
+ LAST_SIGNAL
+};
+
+static guint regress_test_action_signals[LAST_SIGNAL] = { 0 };
+
+static RegressTestAction *
+regress_test_action_do_action (RegressTestAction *self)
+{
+ RegressTestAction *ret = g_object_new (regress_test_action_get_type (), NULL);
+
+ return ret;
+}
+
+static void
+regress_test_action_init (RegressTestAction *self)
+{
+}
+
+static void regress_test_action_class_init (RegressTestActionClass *klass)
+{
+ /**
+ * RegressTestAction::action:
+ *
+ * An action signal.
+ *
+ * Returns: (transfer full): another #RegressTestAction
+ */
+ regress_test_action_signals[ACTION_SIGNAL] =
+ g_signal_new_class_handler ("action",
+ G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+ G_CALLBACK (regress_test_action_do_action), NULL, NULL,
+ NULL, regress_test_action_get_type (), 0);
+}
#ifndef REGRESS_EXTRA_H
#define REGRESS_EXTRA_H
+#include <glib-object.h>
+
typedef struct _RegressTestBoxedC RegressTestBoxedC;
typedef struct _RegressTestBoxedCWrapper RegressTestBoxedCWrapper;
#endif
+/* RegressTestAction */
+
+typedef struct {
+ GInitiallyUnowned parent;
+} RegressTestAction;
+
+typedef struct {
+ GInitiallyUnownedClass parent_class;
+} RegressTestActionClass;
+
+_GI_TEST_EXTERN
+GType regress_test_action_get_type (void);
+
#endif /* REGRESS_EXTRA_H */
# Boxed equality checks pointers by default.
self.assertNotEqual(struct, held_struct)
+ def test_action(self):
+ obj = Regress.TestAction()
+ other_obj = obj.emit('action')
+ self.assertEqual(other_obj.__grefcount__, 1)
+
class TestIntrospectedSignalsIssue158(unittest.TestCase):
"""