commit python-cairocffi for openSUSE:Factory
Hello community, here is the log from the commit of package python-cairocffi for openSUSE:Factory checked in at 2020-11-02 09:39:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-cairocffi (Old) and /work/SRC/openSUSE:Factory/.python-cairocffi.new.3463 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-cairocffi" Mon Nov 2 09:39:30 2020 rev:15 rq:845028 version:1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-cairocffi/python-cairocffi.changes 2019-09-19 15:45:21.335360245 +0200 +++ /work/SRC/openSUSE:Factory/.python-cairocffi.new.3463/python-cairocffi.changes 2020-11-02 09:39:43.269571223 +0100 @@ -1,0 +2,9 @@ +Fri Oct 30 06:20:59 UTC 2020 - Michael Vetter <mvetter@suse.com> + +- Update to 1.2.0: + * #152: Add NumPy support + * #143: Make write_to_png function work on hardened systems + * #156: Use major version name to open shared libraries + * #165: Don’t list setuptools as required for installation + +------------------------------------------------------------------- Old: ---- cairocffi-1.1.0.tar.gz New: ---- cairocffi-1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cairocffi.spec ++++++ --- /var/tmp/diff_new_pack.awBljz/_old 2020-11-02 09:39:43.737571671 +0100 +++ /var/tmp/diff_new_pack.awBljz/_new 2020-11-02 09:39:43.741571675 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-cairocffi # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,14 +12,14 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-cairocffi -Version: 1.1.0 +Version: 1.2.0 Release: 0 Summary: Python cairo bindings based on cffi License: BSD-3-Clause @@ -27,6 +27,7 @@ URL: https://github.com/Kozea/cairocffi Source: https://files.pythonhosted.org/packages/source/c/cairocffi/cairocffi-%{version}.tar.gz BuildRequires: %{python_module cffi >= 1.1.0} +BuildRequires: %{python_module numpy} BuildRequires: %{python_module pytest-runner} BuildRequires: %{python_module setuptools >= 39.2.0} BuildRequires: %{python_module xcffib >= 0.3.2} ++++++ cairocffi-1.1.0.tar.gz -> cairocffi-1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cairocffi-1.1.0/PKG-INFO new/cairocffi-1.2.0/PKG-INFO --- old/cairocffi-1.1.0/PKG-INFO 2019-09-05 16:09:33.000000000 +0200 +++ new/cairocffi-1.2.0/PKG-INFO 2020-10-29 22:27:52.007522800 +0100 @@ -1,19 +1,16 @@ Metadata-Version: 2.1 Name: cairocffi -Version: 1.1.0 +Version: 1.2.0 Summary: cffi-based cairo bindings for Python Home-page: https://github.com/Kozea/cairocffi Author: Simon Sapin -Author-email: community@kozea.fr +Author-email: contact@courtbouillon.org License: BSD Project-URL: Documentation, https://cairocffi.readthedocs.io/ Project-URL: Code, https://github.com/Kozea/cairocffi/ Project-URL: Issue tracker, https://github.com/Kozea/cairocffi/issues -Project-URL: Donation, https://www.patreon.com/kozea -Description: cairocffi - ========= - - cairocffi is a `CFFI`_-based drop-in replacement for Pycairo_, +Project-URL: Donation, https://opencollective.com/courtbouillon +Description: cairocffi is a `CFFI`_-based drop-in replacement for Pycairo_, a set of Python bindings and object-oriented API for cairo_. Cairo is a 2D vector graphics library with support for multiple backends including image buffers, PNG, PostScript, PDF, and SVG file output. @@ -26,15 +23,27 @@ .. _cairo: http://cairographics.org/ .. _GDK-PixBuf: https://gitlab.gnome.org/GNOME/gdk-pixbuf - * `Latest documentation <http://cairocffi.readthedocs.io/en/latest/>`_ - * `Source code and issue tracker <https://github.com/Kozea/cairocffi>`_ - on GitHub. - * Install with ``pip install cairocffi`` - * Python 3.5+. `Tested with CPython and PyPy3 - <https://travis-ci.org/Kozea/cairocffi>`_. + * Free software: BSD license + * For Python 3.6+, tested on CPython and PyPy + * Documentation: https://cairocffi.readthedocs.io + * Changelog: https://github.com/Kozea/cairocffi/releases + * Code, issues, tests: https://github.com/Kozea/cairocffi + * Code of conduct: https://www.courtbouillon.org/code-of-conduct + * Professional support: https://www.courtbouillon.org + * Donation: https://opencollective.com/courtbouillon * API partially compatible with Pycairo. * Works with any version of cairo. + cairocffi has been created and developed by Kozea (https://kozea.fr). + Professional support, maintenance and community management is provided by + CourtBouillon (https://www.courtbouillon.org). + + Copyrights are retained by their contributors, no copyright assignment is + required to contribute to cairocffi. Unless explicitly stated otherwise, any + contribution intentionally submitted for inclusion is licensed under the BSD + 3-clause license, without any additional terms or conditions. For full + authorship information, see the version control history. + Keywords: cairo,cffi,binding Platform: Linux Platform: macOS @@ -43,12 +52,13 @@ Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: BSD License Classifier: Programming Language :: Python :: 3 :: Only -Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 Classifier: Topic :: Multimedia :: Graphics -Requires-Python: >= 3.5 +Requires-Python: >=3.6 Description-Content-Type: text/x-rst -Provides-Extra: test Provides-Extra: doc +Provides-Extra: test Provides-Extra: xcb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cairocffi-1.1.0/README.rst new/cairocffi-1.2.0/README.rst --- old/cairocffi-1.1.0/README.rst 2019-02-06 19:10:15.000000000 +0100 +++ new/cairocffi-1.2.0/README.rst 2020-10-29 22:18:23.000000000 +0100 @@ -1,6 +1,3 @@ -cairocffi -========= - cairocffi is a `CFFI`_-based drop-in replacement for Pycairo_, a set of Python bindings and object-oriented API for cairo_. Cairo is a 2D vector graphics library with support for multiple backends @@ -14,11 +11,23 @@ .. _cairo: http://cairographics.org/ .. _GDK-PixBuf: https://gitlab.gnome.org/GNOME/gdk-pixbuf -* `Latest documentation <http://cairocffi.readthedocs.io/en/latest/>`_ -* `Source code and issue tracker <https://github.com/Kozea/cairocffi>`_ - on GitHub. -* Install with ``pip install cairocffi`` -* Python 3.5+. `Tested with CPython and PyPy3 - <https://travis-ci.org/Kozea/cairocffi>`_. +* Free software: BSD license +* For Python 3.6+, tested on CPython and PyPy +* Documentation: https://cairocffi.readthedocs.io +* Changelog: https://github.com/Kozea/cairocffi/releases +* Code, issues, tests: https://github.com/Kozea/cairocffi +* Code of conduct: https://www.courtbouillon.org/code-of-conduct +* Professional support: https://www.courtbouillon.org +* Donation: https://opencollective.com/courtbouillon * API partially compatible with Pycairo. * Works with any version of cairo. + +cairocffi has been created and developed by Kozea (https://kozea.fr). +Professional support, maintenance and community management is provided by +CourtBouillon (https://www.courtbouillon.org). + +Copyrights are retained by their contributors, no copyright assignment is +required to contribute to cairocffi. Unless explicitly stated otherwise, any +contribution intentionally submitted for inclusion is licensed under the BSD +3-clause license, without any additional terms or conditions. For full +authorship information, see the version control history. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cairocffi-1.1.0/cairocffi/VERSION new/cairocffi-1.2.0/cairocffi/VERSION --- old/cairocffi-1.1.0/cairocffi/VERSION 2019-09-05 16:06:18.000000000 +0200 +++ new/cairocffi-1.2.0/cairocffi/VERSION 2020-10-29 22:27:18.000000000 +0100 @@ -1 +1 @@ -1.1.0 \ No newline at end of file +1.2.0 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cairocffi-1.1.0/cairocffi/__init__.py new/cairocffi-1.2.0/cairocffi/__init__.py --- old/cairocffi-1.1.0/cairocffi/__init__.py 2019-08-12 15:29:06.000000000 +0200 +++ new/cairocffi-1.2.0/cairocffi/__init__.py 2020-10-29 22:18:23.000000000 +0100 @@ -47,7 +47,7 @@ cairo = dlopen( ffi, ('cairo', 'libcairo-2'), - ('libcairo.so', 'libcairo.2.dylib', 'libcairo-2.dll')) + ('libcairo.so.2', 'libcairo.2.dylib', 'libcairo-2.dll')) class _keepref(object): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cairocffi-1.1.0/cairocffi/pixbuf.py new/cairocffi-1.2.0/cairocffi/pixbuf.py --- old/cairocffi-1.1.0/cairocffi/pixbuf.py 2019-08-12 15:29:06.000000000 +0200 +++ new/cairocffi-1.2.0/cairocffi/pixbuf.py 2020-10-29 22:18:23.000000000 +0100 @@ -21,18 +21,18 @@ gdk_pixbuf = dlopen( ffi, ('gdk_pixbuf-2.0', 'libgdk_pixbuf-2.0-0'), - ('libgdk_pixbuf-2.0.so', 'libgdk_pixbuf-2.0.0.dylib', + ('libgdk_pixbuf-2.0.so.0', 'libgdk_pixbuf-2.0.0.dylib', 'libgdk_pixbuf-2.0-0.dll')) gobject = dlopen( ffi, ('gobject-2.0', 'libgobject-2.0-0'), - ('libgobject-2.0.so', 'libgobject-2.0.dylib', 'libgobject-2.0-0.dll')) + ('libgobject-2.0.so.0', 'libgobject-2.0.dylib', 'libgobject-2.0-0.dll')) glib = dlopen( ffi, ('glib-2.0', 'libglib-2.0-0'), - ('libglib-2.0.so', 'libglib-2.0.dylib', 'libglib-2.0-0.dll')) + ('libglib-2.0.so.0', 'libglib-2.0.dylib', 'libglib-2.0-0.dll')) try: gdk = dlopen( ffi, ('gdk-3', 'libgdk-3-0'), - ('libgdk-3.so', 'libgdk-3.0.dylib', 'libgdk-3-0.dll')) + ('libgdk-3.so.0', 'libgdk-3.0.dylib', 'libgdk-3-0.dll')) except OSError: gdk = None @@ -96,7 +96,7 @@ if width and height: gdk_pixbuf.gdk_pixbuf_loader_set_size(loader, width, height) handle_g_error(error, gdk_pixbuf.gdk_pixbuf_loader_write( - loader, ffi.new('guchar[]', image_data), len(image_data), error)) + loader, image_data, len(image_data), error)) handle_g_error(error, gdk_pixbuf.gdk_pixbuf_loader_close(loader, error)) format_ = gdk_pixbuf.gdk_pixbuf_loader_get_format(loader) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cairocffi-1.1.0/cairocffi/surfaces.py new/cairocffi-1.2.0/cairocffi/surfaces.py --- old/cairocffi-1.1.0/cairocffi/surfaces.py 2019-02-06 22:50:51.000000000 +0100 +++ new/cairocffi-1.2.0/cairocffi/surfaces.py 2020-10-29 22:18:23.000000000 +0100 @@ -11,9 +11,13 @@ import ctypes import io +import operator import os import sys import weakref +from functools import reduce +from pathlib import Path +from tempfile import NamedTemporaryFile from . import _check_status, _keepref, cairo, constants, ffi from .fonts import FontOptions, _encode_string @@ -76,6 +80,10 @@ # Looks like a array.array object. address, length = obj.buffer_info() return address, length * obj.itemsize + elif hasattr(obj, '__array_interface__'): + # Looks like a numpy.ndarray object + length = reduce(operator.mul, obj.shape) + return ctypes.addressof(ctypes.c_char.from_buffer(obj)), length else: # Other buffers. # XXX Unfortunately ctypes.c_char.from_buffer @@ -148,7 +156,11 @@ self._pointer = ffi.gc( pointer, _keepref(cairo, cairo.cairo_surface_destroy)) self._check_status() - if target_keep_alive not in (None, ffi.NULL): + if hasattr(target_keep_alive, '__array_interface__'): + is_empty = target_keep_alive.size == 0 + else: + is_empty = target_keep_alive in (None, ffi.NULL) + if not is_empty: keep_alive = KeepAlive(target_keep_alive) _check_status(cairo.cairo_surface_set_user_data( self._pointer, SURFACE_TARGET_KEY, *keep_alive.closure)) @@ -643,9 +655,25 @@ if return_bytes: target = io.BytesIO() if hasattr(target, 'write'): - write_func = _make_write_func(target) - _check_status(cairo.cairo_surface_write_to_png_stream( - self._pointer, write_func, ffi.NULL)) + try: + write_func = _make_write_func(target) + _check_status(cairo.cairo_surface_write_to_png_stream( + self._pointer, write_func, ffi.NULL)) + except SystemError: # noqa + # Callback creation has failed + if hasattr(target, 'name'): + # File-like object has a name, write here + _check_status(cairo.cairo_surface_write_to_png( + self._pointer, _encode_filename(target.name))) + else: + # Use a fallback temporary file + with NamedTemporaryFile('wb', delete=False) as fd: + filename = fd.name + _check_status(cairo.cairo_surface_write_to_png( + self._pointer, _encode_filename(filename))) + png_file = Path(filename) + target.write(png_file.read_bytes()) + png_file.unlink() else: _check_status(cairo.cairo_surface_write_to_png( self._pointer, _encode_filename(target))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cairocffi-1.1.0/cairocffi/test_numpy.py new/cairocffi-1.2.0/cairocffi/test_numpy.py --- old/cairocffi-1.1.0/cairocffi/test_numpy.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cairocffi-1.2.0/cairocffi/test_numpy.py 2020-10-29 22:18:23.000000000 +0100 @@ -0,0 +1,16 @@ +import math + +import cairocffi as cairo +import numpy + + +def test_numpy(): + data = numpy.zeros((200, 200, 4), dtype=numpy.uint8) + surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 200, 200, data=data) + cr = cairo.Context(surface) + cr.set_source_rgb(1.0, 1.0, 1.0) + cr.paint() + cr.arc(100, 100, 80, 0, 2*math.pi) + cr.set_line_width(3) + cr.set_source_rgb(1.0, 0.0, 0.0) + cr.stroke() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cairocffi-1.1.0/cairocffi.egg-info/PKG-INFO new/cairocffi-1.2.0/cairocffi.egg-info/PKG-INFO --- old/cairocffi-1.1.0/cairocffi.egg-info/PKG-INFO 2019-09-05 16:09:33.000000000 +0200 +++ new/cairocffi-1.2.0/cairocffi.egg-info/PKG-INFO 2020-10-29 22:27:51.000000000 +0100 @@ -1,19 +1,16 @@ Metadata-Version: 2.1 Name: cairocffi -Version: 1.1.0 +Version: 1.2.0 Summary: cffi-based cairo bindings for Python Home-page: https://github.com/Kozea/cairocffi Author: Simon Sapin -Author-email: community@kozea.fr +Author-email: contact@courtbouillon.org License: BSD Project-URL: Documentation, https://cairocffi.readthedocs.io/ Project-URL: Code, https://github.com/Kozea/cairocffi/ Project-URL: Issue tracker, https://github.com/Kozea/cairocffi/issues -Project-URL: Donation, https://www.patreon.com/kozea -Description: cairocffi - ========= - - cairocffi is a `CFFI`_-based drop-in replacement for Pycairo_, +Project-URL: Donation, https://opencollective.com/courtbouillon +Description: cairocffi is a `CFFI`_-based drop-in replacement for Pycairo_, a set of Python bindings and object-oriented API for cairo_. Cairo is a 2D vector graphics library with support for multiple backends including image buffers, PNG, PostScript, PDF, and SVG file output. @@ -26,15 +23,27 @@ .. _cairo: http://cairographics.org/ .. _GDK-PixBuf: https://gitlab.gnome.org/GNOME/gdk-pixbuf - * `Latest documentation <http://cairocffi.readthedocs.io/en/latest/>`_ - * `Source code and issue tracker <https://github.com/Kozea/cairocffi>`_ - on GitHub. - * Install with ``pip install cairocffi`` - * Python 3.5+. `Tested with CPython and PyPy3 - <https://travis-ci.org/Kozea/cairocffi>`_. + * Free software: BSD license + * For Python 3.6+, tested on CPython and PyPy + * Documentation: https://cairocffi.readthedocs.io + * Changelog: https://github.com/Kozea/cairocffi/releases + * Code, issues, tests: https://github.com/Kozea/cairocffi + * Code of conduct: https://www.courtbouillon.org/code-of-conduct + * Professional support: https://www.courtbouillon.org + * Donation: https://opencollective.com/courtbouillon * API partially compatible with Pycairo. * Works with any version of cairo. + cairocffi has been created and developed by Kozea (https://kozea.fr). + Professional support, maintenance and community management is provided by + CourtBouillon (https://www.courtbouillon.org). + + Copyrights are retained by their contributors, no copyright assignment is + required to contribute to cairocffi. Unless explicitly stated otherwise, any + contribution intentionally submitted for inclusion is licensed under the BSD + 3-clause license, without any additional terms or conditions. For full + authorship information, see the version control history. + Keywords: cairo,cffi,binding Platform: Linux Platform: macOS @@ -43,12 +52,13 @@ Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: BSD License Classifier: Programming Language :: Python :: 3 :: Only -Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 Classifier: Topic :: Multimedia :: Graphics -Requires-Python: >= 3.5 +Requires-Python: >=3.6 Description-Content-Type: text/x-rst -Provides-Extra: test Provides-Extra: doc +Provides-Extra: test Provides-Extra: xcb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cairocffi-1.1.0/cairocffi.egg-info/SOURCES.txt new/cairocffi-1.2.0/cairocffi.egg-info/SOURCES.txt --- old/cairocffi-1.1.0/cairocffi.egg-info/SOURCES.txt 2019-09-05 16:09:33.000000000 +0200 +++ new/cairocffi-1.2.0/cairocffi.egg-info/SOURCES.txt 2020-10-29 22:27:51.000000000 +0100 @@ -13,6 +13,7 @@ cairocffi/pixbuf.py cairocffi/surfaces.py cairocffi/test_cairo.py +cairocffi/test_numpy.py cairocffi/test_pixbuf.py cairocffi/test_xcb.py cairocffi/xcb.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cairocffi-1.1.0/cairocffi.egg-info/requires.txt new/cairocffi-1.2.0/cairocffi.egg-info/requires.txt --- old/cairocffi-1.1.0/cairocffi.egg-info/requires.txt 2019-09-05 16:09:33.000000000 +0200 +++ new/cairocffi-1.2.0/cairocffi.egg-info/requires.txt 2020-10-29 22:27:51.000000000 +0100 @@ -1,5 +1,4 @@ cffi>=1.1.0 -setuptools>=39.2.0 [doc] sphinx diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cairocffi-1.1.0/setup.cfg new/cairocffi-1.2.0/setup.cfg --- old/cairocffi-1.1.0/setup.cfg 2019-09-05 16:09:33.000000000 +0200 +++ new/cairocffi-1.2.0/setup.cfg 2020-10-29 22:27:52.007522800 +0100 @@ -8,7 +8,7 @@ long_description = file: README.rst long_description_content_type = text/x-rst author = Simon Sapin -author_email = community@kozea.fr +author_email = contact@courtbouillon.org platforms = Linux macOS @@ -22,15 +22,16 @@ Intended Audience :: Developers License :: OSI Approved :: BSD License Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 Topic :: Multimedia :: Graphics project_urls = Documentation = https://cairocffi.readthedocs.io/ Code = https://github.com/Kozea/cairocffi/ Issue tracker = https://github.com/Kozea/cairocffi/issues - Donation = https://www.patreon.com/kozea + Donation = https://opencollective.com/courtbouillon [options] packages = find: @@ -40,13 +41,13 @@ setuptools install_requires = cffi >= 1.1.0 - setuptools >= 39.2.0 tests_require = pytest-cov pytest-flake8 pytest-isort pytest-runner -python_requires = >= 3.5 + numpy +python_requires = >= 3.6 [options.package_data] cairocffi = VERSION @@ -83,7 +84,7 @@ cairocffi/_generated/*.py [isort] -default_section = THIRDPARTY +default_section = FIRSTPARTY multi_line_output = 4 [coverage:report]
participants (1)
-
root