From 9899fe5c5546e1bcf16c21555ea158b1d96155f4 Mon Sep 17 00:00:00 2001 From: David King Date: Mon, 18 Apr 2022 16:05:53 +0100 Subject: [PATCH] Update to 1.21.0 (#1967786) --- .gitignore | 1 + pycairo-1.21.0-cairo-1.17.6-tests.patch | 101 ++++++++++++++++++++++++ pycairo.spec | 17 ++-- sources | 2 +- 4 files changed, 114 insertions(+), 7 deletions(-) create mode 100644 pycairo-1.21.0-cairo-1.17.6-tests.patch diff --git a/.gitignore b/.gitignore index 473c940..630c2f8 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ pycairo-1.8.8.tar.gz /pycairo-1.18.2.tar.gz /pycairo-1.20.0.tar.gz /pycairo-1.20.1.tar.gz +/pycairo-1.21.0.tar.gz diff --git a/pycairo-1.21.0-cairo-1.17.6-tests.patch b/pycairo-1.21.0-cairo-1.17.6-tests.patch new file mode 100644 index 0000000..ad78499 --- /dev/null +++ b/pycairo-1.21.0-cairo-1.17.6-tests.patch @@ -0,0 +1,101 @@ +From 807241feafdd04c2b90c92c86dc4e00bc06a3d33 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sat, 19 Mar 2022 17:36:03 +0100 +Subject: [PATCH 1/3] tests: test passing a font family to ToyFontFace +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The new backend in cairo 1.17.6 has problems with this, but we never +tested this directly on the Python level. + +Śee https://gitlab.freedesktop.org/cairo/cairo/-/issues/544 +--- + tests/test_font.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tests/test_font.py b/tests/test_font.py +index c4dfa80..5d3e27a 100644 +--- a/tests/test_font.py ++++ b/tests/test_font.py +@@ -204,6 +204,10 @@ def test_toy_font_face(): + def test_toy_font_get_family(): + font_face = cairo.ToyFontFace("") + assert isinstance(font_face.get_family(), str) ++ font_face = cairo.ToyFontFace("serif") ++ assert isinstance(font_face.get_family(), str) ++ font_face = cairo.ToyFontFace("sans-serif") ++ assert isinstance(font_face.get_family(), str) + + + def test_toy_font_get_slant(): + +From 678edd94d8a6dfb5d51f9c3549e6ee8c90a73744 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sat, 19 Mar 2022 17:37:32 +0100 +Subject: [PATCH 2/3] tests: allow a different default document unit for + SVGSurface + +It was changed upstream, despite being documented. + +See https://gitlab.freedesktop.org/cairo/cairo/-/issues/545 +--- + tests/test_surface.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tests/test_surface.py b/tests/test_surface.py +index 20f1bd4..503bc50 100644 +--- a/tests/test_surface.py ++++ b/tests/test_surface.py +@@ -267,7 +267,10 @@ def test_svg_version_to_string(): + reason="too old cairo") + def test_svg_surface_get_document_unit(): + with cairo.SVGSurface(None, 10, 10) as surface: +- assert surface.get_document_unit() == cairo.SVGUnit.PT ++ # https://gitlab.freedesktop.org/cairo/cairo/-/issues/545 ++ assert surface.get_document_unit() in [cairo.SVGUnit.PT, cairo.SVGUnit.USER] ++ ++ with cairo.SVGSurface(None, 10, 10) as surface: + surface.set_document_unit(cairo.SVGUnit.PX) + assert surface.get_document_unit() == cairo.SVGUnit.PX + with pytest.raises(cairo.Error): + +From 843e3db002e8d114362e6714babfffc400dbe4c0 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sat, 19 Mar 2022 18:10:53 +0100 +Subject: [PATCH 3/3] CI: add a special hypothesis settings profile for CI + +Increase the deadline and run more tests +--- + tests/test_hypothesis.py | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/tests/test_hypothesis.py b/tests/test_hypothesis.py +index 80ebb5b..c76bc31 100644 +--- a/tests/test_hypothesis.py ++++ b/tests/test_hypothesis.py +@@ -17,6 +17,16 @@ + from .hypothesis_fspaths import fspaths + + ++if "CI" in os.environ: ++ # CI can be slow, so be patient ++ # Also we can run more tests there ++ settings.register_profile( ++ "ci", ++ deadline=settings.default.deadline * 5, ++ max_examples=settings.default.max_examples * 5) ++ settings.load_profile("ci") ++ ++ + @pytest.fixture(scope='module') + def tempdir_path(): + dir_ = tempfile.mkdtemp() +@@ -44,7 +54,6 @@ def cairo_ver(): + platform.python_implementation() == "PyPy" and sys.pypy_version_info < (7, 3, 0), + reason="PyPy bugs") + @given(path=fspaths()) +-@settings(max_examples=500) + def test_fspaths(tempdir_path, path): + p = _to_temp_path(tempdir_path, path) + diff --git a/pycairo.spec b/pycairo.spec index 4990a80..097824c 100644 --- a/pycairo.spec +++ b/pycairo.spec @@ -1,15 +1,16 @@ -Name: pycairo -Version: 1.20.1 -Release: 2%{?dist} +Name: pycairo +Version: 1.21.0 +Release: 1%{?dist} Summary: Python bindings for the cairo library License: MPLv1.1 or LGPLv2 -URL: http://cairographics.org/pycairo +URL: https://www.cairographics.org/pycairo Source0: https://github.com/pygobject/pycairo/releases/download/v%{version}/pycairo-%{version}.tar.gz +# https://github.com/pygobject/pycairo/pull/264 +Patch0: pycairo-1.21.0-cairo-1.17.6-tests.patch -BuildRequires: cairo-devel +BuildRequires: pkgconfig(cairo) BuildRequires: gcc -BuildRequires: pkgconfig BuildRequires: python3-devel BuildRequires: python3-pytest BuildRequires: python3-setuptools @@ -47,6 +48,7 @@ libraries so that they interoperate with py3cairo. %files -n python3-cairo %license COPYING* +%doc README.rst %{python3_sitearch}/cairo/ %{python3_sitearch}/pycairo*.egg-info @@ -56,6 +58,9 @@ libraries so that they interoperate with py3cairo. %{_libdir}/pkgconfig/py3cairo.pc %changelog +* Sun Apr 17 2022 David King - 1.21.0-1 +- Update to 1.21.0 (#1967786) + * Fri Jan 21 2022 Fedora Release Engineering - 1.20.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/sources b/sources index 9424219..cc84c67 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pycairo-1.20.1.tar.gz) = bb2340170c1d39d50dd8ceeb1b6ceadd96ddbd27d78a8a5b7dadf7dc427558d766f65d62e1ceeae19ab200e7ffb5ad122b5e51daa8ef9bff08fcd97a44005697 +SHA512 (pycairo-1.21.0.tar.gz) = 0de226b05d0a358f3546e4a0d5bf342f124373718d4900c891a09c1ede11e3ed1fb9bee163c00acfc215044683ddf0b29c8573b7454f9c39f957a47d63c34baf