diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 6b20ced..0000000 --- a/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2013-2019, Simon Sapin and contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cairocffi-1.4.0.tar.gz b/cairocffi-1.4.0.tar.gz deleted file mode 100644 index f1bd739..0000000 --- a/cairocffi-1.4.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:509339b32ccd8d7b00c2204c32736cde78db53a32e6a162d312478d25626cd9a -size 69851 diff --git a/cairocffi-1.5.1.tar.gz b/cairocffi-1.5.1.tar.gz new file mode 100644 index 0000000..5d95060 --- /dev/null +++ b/cairocffi-1.5.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:071ab7b72e3533300b0bfd55a52056b4ffdc1ed6e656779e2aced9b709b8a295 +size 86924 diff --git a/python-cairocffi.changes b/python-cairocffi.changes index 0ffdbd9..9de9538 100644 --- a/python-cairocffi.changes +++ b/python-cairocffi.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Fri May 5 09:45:47 UTC 2023 - Dirk Müller + +- update to 1.5.1: + * move to pyproject.toml + * Try to support and test more Python versions + * Catch more errors when creating PNG files + * Include utils and docs in the source package + * Include all Setuptool’s building functions in custom + building script + * Build generated files manually when building wheels + * Install xcffib if possible during the wheel generation +- add skip-pikepdf.patch to skip pikepdf from tests +- use LICENSE from package + ------------------------------------------------------------------- Fri Apr 21 12:23:03 UTC 2023 - Dirk Müller diff --git a/python-cairocffi.spec b/python-cairocffi.spec index e7307cd..44a30d0 100644 --- a/python-cairocffi.spec +++ b/python-cairocffi.spec @@ -18,20 +18,19 @@ %{?sle15_python_module_pythons} Name: python-cairocffi -Version: 1.4.0 +Version: 1.5.1 Release: 0 Summary: Python cairo bindings based on cffi License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/Kozea/cairocffi Source: https://files.pythonhosted.org/packages/source/c/cairocffi/cairocffi-%{version}.tar.gz -# https://github.com/Kozea/cairocffi/issues/208 -Source1: https://raw.githubusercontent.com/Kozea/cairocffi/master/LICENSE +# avoid pikepdf in Ring1, skipping the pikepdf related tests +Patch1: skip-pikepdf.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module cffi >= 1.1.0} -# we don't want pikepdf in Ring1 stagings -#BuildRequires: %{python_module pikepdf} -BuildRequires: %{python_module setuptools >= 39.2.0} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module wheel} BuildRequires: %{python_module xcffib >= 0.3.2} BuildRequires: cairo Requires: cairo @@ -70,33 +69,18 @@ including image buffers, PNG, PostScript, PDF, and SVG file output. This package provides the optional gdk-pixbuf image loader module. %prep -%autosetup -n cairocffi-%{version} -p1 -cp %{SOURCE1} . -# disable development tools for unit tests. Remove deprecated pytest-runner -sed -i -e 's/pytest-runner$/pytest/' \ - -e '/pytest-flake8$/ d' \ - -e '/pytest-isort$/ d' \ - -e '/pytest-cov$/ d' \ - -e '/^addopts.*flake8.*isort$/ d' setup.cfg - -mkdir tests -mv cairocffi/test_*.py tests/ -sed -i 's/^from \. /from cairocffi /' tests/*.py -sed -i 's/^from \./from cairocffi./' tests/*.py +%autosetup -p1 -n cairocffi-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -cd tests/ -# test_cairo.py needs pikepdf, remove it -rm test_cairo.py # Switch off test_xcb_window (gh#Kozea/cairocffi#203) -%python_expand PYTHONPATH="%{buildroot}%{$python_sitelib}" xvfb-run --server-args="-screen 0 1280x1024x16" $python -m pytest -k "not test_xcb_window" *.py +%python_expand PYTHONPATH="%{buildroot}%{$python_sitelib}" xvfb-run --server-args="-screen 0 1280x1024x16" $python -m pytest -k "not test_xcb_window" %files %{python_files} %license LICENSE diff --git a/skip-pikepdf.patch b/skip-pikepdf.patch new file mode 100644 index 0000000..2c04755 --- /dev/null +++ b/skip-pikepdf.patch @@ -0,0 +1,52 @@ +Index: cairocffi-1.5.1/cairocffi/test_cairo.py +=================================================================== +--- cairocffi-1.5.1.orig/cairocffi/test_cairo.py ++++ cairocffi-1.5.1/cairocffi/test_cairo.py +@@ -21,7 +21,6 @@ import sys + import tempfile + + import cairocffi +-import pikepdf + import pytest + + from . import ( +@@ -239,6 +238,7 @@ def test_device_scale(): + + @pytest.mark.xfail(cairo_version() < 11504, + reason='Cairo version too low') ++@pytest.mark.skip(reason="No pikepdf") + def test_metadata(): + file_obj = io.BytesIO() + surface = PDFSurface(file_obj, 1, 1) +@@ -264,6 +264,7 @@ def test_metadata(): + + @pytest.mark.xfail(cairo_version() < 11504, + reason='Cairo version too low') ++@pytest.mark.skip(reason="No pikepdf") + def test_outline(): + file_obj = io.BytesIO() + surface = PDFSurface(file_obj, 1, 1) +@@ -280,6 +281,7 @@ def test_outline(): + + @pytest.mark.xfail(cairo_version() < 11504, + reason='Cairo version too low') ++@pytest.mark.skip(reason="No pikepdf") + def test_page_label(): + file_obj = io.BytesIO() + surface = PDFSurface(file_obj, 1, 1) +@@ -291,6 +293,7 @@ def test_page_label(): + + @pytest.mark.xfail(cairo_version() < 11504, + reason='Cairo version too low') ++@pytest.mark.skip(reason="No pikepdf") + def test_tag(): + file_obj = io.BytesIO() + surface = PDFSurface(file_obj, 10, 10) +@@ -419,6 +422,7 @@ def test_pdf_versions(): + assert file_obj.getvalue().startswith(b'%PDF-1.4') + + ++@pytest.mark.skip(reason="No pikepdf") + def test_pdf_surface(): + with temp_directory() as tempdir: + filename = os.path.join(tempdir, 'foo.pdf')