script:
- bash -x ./.gitlab-ci/test-docker-old.sh
-gnome-master:
- allow_failure: true
+gnome-runtime:
stage: build_and_test
- image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
+ image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.30
script:
- - xvfb-run -a flatpak run --filesystem=host --share=network --socket=x11 --command=bash org.gnome.Sdk//master -x .gitlab-ci/test-flatpak.sh
+ - xvfb-run -a flatpak run --filesystem=host --share=network --socket=x11 --command=bash org.gnome.Sdk//3.30 -x .gitlab-ci/test-flatpak.sh
meson _build -Dpython="$(which python)"
fi
ninja -C _build
-xvfb-run -a meson test -C _build -v
+xvfb-run -a meson test --timeout-multiplier 4 -C _build -v
rm -Rf _build
# CODE QUALITY
$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
-
-./lcov-master/bin/lcov \
- --rc lcov_branch_coverage=1 --no-external \
- --directory . --capture --output-file \
- "${COV_DIR}/${COV_KEY}.lcov"
+# 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"
+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.30.4 - 2018-11-30
-------------------
except OSError:
return None
mode = filestat.st_mode
- if column is 0:
+ if column == 0:
if stat.S_ISDIR(mode):
return folderpb
else:
return filepb
- elif column is 1:
+ elif column == 1:
return rowref
- elif column is 2:
+ elif column == 2:
return filestat.st_size
- elif column is 3:
+ elif column == 3:
return oct(stat.S_IMODE(mode))
return time.ctime(filestat.st_mtime)
except OSError:
return None
mode = filestat.st_mode
- if column is 0:
+ if column == 0:
if stat.S_ISDIR(mode):
return folderpb
else:
return filepb
- elif column is 1:
+ elif column == 1:
return os.path.basename(relpath)
- elif column is 2:
+ elif column == 2:
return filestat.st_size
- elif column is 3:
+ elif column == 3:
return oct(stat.S_IMODE(mode))
return time.ctime(filestat.st_mtime)
return;
free_array = TRUE;
- free_array_full = FALSE;
+ free_array_full = arg_cache->transfer != GI_TRANSFER_NOTHING;
} else if (array_cache->array_type == GI_ARRAY_TYPE_PTR_ARRAY) {
ptr_array_ = (GPtrArray *) data;
} else {
*
* Checks to see if @error has been set. If @error has been set, then a
* GLib.GError Python exception object is returned (but not raised).
+ * If not error is set returns Py_None.
*
- * Returns: a GLib.GError Python exception object, or NULL.
+ * Returns: a GLib.GError Python exception object, or Py_None,
+ * or NULL and sets an error if creating the exception object fails.
*/
PyObject *
pygi_error_marshal_to_py (GError **error)
g_return_val_if_fail(error != NULL, NULL);
if (*error == NULL)
- return NULL;
+ Py_RETURN_NONE;
state = PyGILState_Ensure();
state = PyGILState_Ensure();
exc_instance = pygi_error_marshal_to_py (error);
- PyErr_SetObject(PyGError, exc_instance);
- Py_DECREF(exc_instance);
+ if (exc_instance != NULL) {
+ PyErr_SetObject(PyGError, exc_instance);
+ Py_DECREF(exc_instance);
+ } else {
+ PyErr_Print ();
+ PyErr_SetString (PyExc_RuntimeError, "Converting the GError failed");
+ }
g_clear_error(error);
PyGILState_Release(state);
g_error_free (error);
}
- if (py_obj != NULL) {
- return py_obj;
- } else {
- Py_RETURN_NONE;
- }
+ return py_obj;
}
static gboolean
{
GError *gerror = (GError *) g_value_get_boxed (value);
PyObject *pyerr = pygi_error_marshal_to_py (&gerror);
- if (pyerr == NULL) {
- Py_RETURN_NONE;
- } else {
- return pyerr;
- }
+ return pyerr;
}
static int
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. */
project('pygobject', 'c',
- version : '3.30.4',
+ version : '3.30.5',
meson_version : '>= 0.46.0',
default_options : [ 'warning_level=1',
'buildtype=debugoptimized'])
'-Wall',
'-Warray-bounds',
'-Wcast-align',
- '-Wdeclaration-after-statement',
'-Wduplicated-branches',
'-Wextra',
'-Wformat=2',
'-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',
'-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
from distutils.spawn import find_executable
-PYGOBJECT_VERSION = "3.30.4"
+PYGOBJECT_VERSION = "3.30.5"
GLIB_VERSION_REQUIRED = "2.38.0"
GI_VERSION_REQUIRED = "1.46.0"
PYCAIRO_VERSION_REQUIRED = "1.11.1"
"-Wall",
"-Warray-bounds",
"-Wcast-align",
- "-Wdeclaration-after-statement",
"-Wduplicated-branches",
"-Wextra",
"-Wformat=2",
"-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 += [
*
* Copyright (C) 2016 Thibault Saunier <tsaunier@gnome.org>
*
- * This file is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 3 of the
- * License, or (at your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "gimarshallingtestsextra.h"
*
* Copyright (C) 2016 Thibault Saunier <tsaunier@gnome.org>
*
- * This file is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 3 of the
- * License, or (at your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EXTRA_TESTS
import contextlib
import unittest
-import time
import sys
import gc
import warnings
+import timeit
from .helper import ignore_gi_deprecation_warnings, capture_glib_warnings
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):