From 4f5e339dacd47b45cb2395b29d9204c61fbd676167d7d2080a8984fa5f823e1b Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 15 Sep 2022 07:43:08 +0000 Subject: [PATCH] Accepting request 1003554 from home:iznogood:factory - Add python-cairocffi-xfail.patch: Xfail some tests failing with cairo 1.17.6. - Add python-cairocffi-disable-linters.patch: Drop linters that fail with new cairo. OBS-URL: https://build.opensuse.org/request/show/1003554 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cairocffi?expand=0&rev=45 --- python-cairocffi-disable-linters.patch | 41 +++++++++++++ python-cairocffi-xfail.patch | 80 ++++++++++++++++++++++++++ python-cairocffi.changes | 8 +++ python-cairocffi.spec | 7 ++- 4 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 python-cairocffi-disable-linters.patch create mode 100644 python-cairocffi-xfail.patch diff --git a/python-cairocffi-disable-linters.patch b/python-cairocffi-disable-linters.patch new file mode 100644 index 0000000..976633a --- /dev/null +++ b/python-cairocffi-disable-linters.patch @@ -0,0 +1,41 @@ +diff --git a/setup.cfg b/setup.cfg +index 6ab6258..5ff9032 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -36,15 +36,11 @@ project_urls = + packages = find: + setup_requires = + cffi >= 1.1.0 +- pytest-runner + setuptools + install_requires = + cffi >= 1.1.0 + tests_require = +- pytest-cov +- pytest-flake8 +- pytest-isort +- pytest-runner ++ pytest + numpy + python_requires = >= 3.7 + +@@ -59,10 +55,7 @@ doc = + sphinx + sphinx_rtd_theme + test = +- pytest-runner +- pytest-cov +- pytest-flake8 +- pytest-isort ++ pytest + xcb = + xcffib >= 0.3.2 + +@@ -74,7 +67,6 @@ build-dir = docs/_build + test = pytest + + [tool:pytest] +-addopts = --flake8 --isort + norecursedirs = build dist .cache .eggs .git + + [flake8] diff --git a/python-cairocffi-xfail.patch b/python-cairocffi-xfail.patch new file mode 100644 index 0000000..3acd089 --- /dev/null +++ b/python-cairocffi-xfail.patch @@ -0,0 +1,80 @@ +diff --git a/cairocffi/test_cairo.py b/cairocffi/test_cairo.py +index 867c9cf..e086415 100644 +--- a/cairocffi/test_cairo.py ++++ b/cairocffi/test_cairo.py +@@ -236,8 +236,8 @@ def test_device_scale(): + assert surface.get_device_scale() == (2, 3) + + +-@pytest.mark.xfail(cairo_version() < 11504, +- reason='Cairo version too low') ++@pytest.mark.xfail(not (11504 <= cairo_version() < 11706), ++ reason='Cairo version too bad') + def test_metadata(): + file_obj = io.BytesIO() + surface = PDFSurface(file_obj, 1, 1) +@@ -261,8 +261,8 @@ def test_metadata(): + assert b'/ModDate (20130721234600Z)' in pdf_bytes + + +-@pytest.mark.xfail(cairo_version() < 11504, +- reason='Cairo version too low') ++@pytest.mark.xfail(not (11504 <= cairo_version() < 11706), ++ reason='Cairo version too bad') + def test_outline(): + file_obj = io.BytesIO() + surface = PDFSurface(file_obj, 1, 1) +@@ -276,8 +276,8 @@ def test_outline(): + assert b'/Title (title 2)' in pdf_bytes + + +-@pytest.mark.xfail(cairo_version() < 11504, +- reason='Cairo version too low') ++@pytest.mark.xfail(not (11504 <= cairo_version() < 11706), ++ reason='Cairo version too bad') + def test_page_label(): + file_obj = io.BytesIO() + surface = PDFSurface(file_obj, 1, 1) +@@ -287,8 +287,8 @@ def test_page_label(): + assert b'/P (abc)' in pdf_bytes + + +-@pytest.mark.xfail(cairo_version() < 11504, +- reason='Cairo version too low') ++@pytest.mark.xfail(not (11504 <= cairo_version() < 11706), ++ reason='Cairo version too bad') + def test_tag(): + file_obj = io.BytesIO() + surface = PDFSurface(file_obj, 10, 10) +@@ -327,8 +327,8 @@ def test_thumbnail_size(): + assert len(pdf_bytes1) < len(pdf_bytes2) + + +-@pytest.mark.xfail(cairo_version() < 11510, +- reason='Cairo version too low') ++@pytest.mark.xfail(not (11510 <= cairo_version() < 11706), ++ reason='Cairo version too bad') + def test_document_unit(): + surface = SVGSurface(None, 1, 2) + assert surface.get_document_unit() == SVG_UNIT_PT +@@ -395,8 +395,8 @@ def test_png(): + surface = ImageSurface.create_from_png(io.BytesIO(b'')) + + +-@pytest.mark.xfail(cairo_version() < 11000, +- reason='Cairo version too low') ++@pytest.mark.xfail(not (11000 <= cairo_version() < 11706), ++ reason='Cairo version too bad') + def test_pdf_versions(): + assert set(PDFSurface.get_versions()) >= set([ + cairocffi.PDF_VERSION_1_4, cairocffi.PDF_VERSION_1_5]) +@@ -417,6 +417,8 @@ def test_pdf_versions(): + assert file_obj.getvalue().startswith(b'%PDF-1.4') + + ++@pytest.mark.xfail(not (cairo_version() < 11706), ++ reason='Cairo version too bad') + def test_pdf_surface(): + with temp_directory() as tempdir: + filename = os.path.join(tempdir, 'foo.pdf') + diff --git a/python-cairocffi.changes b/python-cairocffi.changes index b5d04fb..b578451 100644 --- a/python-cairocffi.changes +++ b/python-cairocffi.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Sep 13 15:56:49 UTC 2022 - Bjørn Lie + +- Add python-cairocffi-xfail.patch: Xfail some tests failing with + cairo 1.17.6. +- Add python-cairocffi-disable-linters.patch: Drop linters that + fail with new cairo. + ------------------------------------------------------------------- Sat Aug 20 21:23:34 UTC 2022 - Matej Cepl diff --git a/python-cairocffi.spec b/python-cairocffi.spec index 47669fd..9815cf4 100644 --- a/python-cairocffi.spec +++ b/python-cairocffi.spec @@ -24,6 +24,11 @@ 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 +# PATCH-FIX-UPSTREAM python-cairocffi-xfail.patch -- Xfail some tests failing with cairo 1.17.6 +Patch: python-cairocffi-xfail.patch +# PATCH-FIX-OPENSUSE python-cairocffi-disable-linters.patch -- Disable linters tests +Patch2: python-cairocffi-disable-linters.patch + BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module cffi >= 1.1.0} BuildRequires: %{python_module setuptools >= 39.2.0} @@ -65,7 +70,7 @@ including image buffers, PNG, PostScript, PDF, and SVG file output. This package provides the optional gdk-pixbuf image loader module. %prep -%setup -q -n cairocffi-%{version} +%autosetup -n cairocffi-%{version} -p1 # disable development tools for unit tests. Remove deprecated pytest-runner sed -i -e 's/pytest-runner$/pytest/' \ -e '/pytest-flake8$/ d' \