Accepting request 1006473 from home:mcalabkova:branches:devel:languages:python
- Update to 1.4.0 * #205: Use pikepdf to parse generated PDF * #171: Don’t use deprecated pytest-runner anymore - Drop no longer needed python-cairocffi-xfail.patch and python-cairocffi-disable-linters.patch OBS-URL: https://build.opensuse.org/request/show/1006473 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cairocffi?expand=0&rev=47
This commit is contained in:
parent
4f5e339dac
commit
d0606dd48e
29
LICENSE
Normal file
29
LICENSE
Normal file
@ -0,0 +1,29 @@
|
||||
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.
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:108a3a7cb09e203bdd8501d9baad91d786d204561bd71e9364e8b34897c47b91
|
||||
size 88784
|
3
cairocffi-1.4.0.tar.gz
Normal file
3
cairocffi-1.4.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:509339b32ccd8d7b00c2204c32736cde78db53a32e6a162d312478d25626cd9a
|
||||
size 69851
|
@ -1,41 +0,0 @@
|
||||
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]
|
@ -1,80 +0,0 @@
|
||||
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')
|
||||
|
@ -1,3 +1,12 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Sep 27 17:04:28 UTC 2022 - Markéta Machová <mmachova@suse.com>
|
||||
|
||||
- Update to 1.4.0
|
||||
* #205: Use pikepdf to parse generated PDF
|
||||
* #171: Don’t use deprecated pytest-runner anymore
|
||||
- Drop no longer needed python-cairocffi-xfail.patch and
|
||||
python-cairocffi-disable-linters.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Sep 13 15:56:49 UTC 2022 - Bjørn Lie <bjorn.lie@gmail.com>
|
||||
|
||||
|
@ -17,20 +17,18 @@
|
||||
|
||||
|
||||
Name: python-cairocffi
|
||||
Version: 1.3.0
|
||||
Version: 1.4.0
|
||||
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
|
||||
# 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
|
||||
|
||||
# https://github.com/Kozea/cairocffi/issues/208
|
||||
Source1: https://raw.githubusercontent.com/Kozea/cairocffi/master/LICENSE
|
||||
BuildRequires: %{python_module base >= 3.7}
|
||||
BuildRequires: %{python_module cffi >= 1.1.0}
|
||||
BuildRequires: %{python_module pikepdf}
|
||||
BuildRequires: %{python_module setuptools >= 39.2.0}
|
||||
BuildRequires: %{python_module xcffib >= 0.3.2}
|
||||
BuildRequires: cairo
|
||||
@ -71,6 +69,7 @@ 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' \
|
||||
@ -95,7 +94,7 @@ cd tests/
|
||||
# Don't test with NumPy in the python36 flavor, because python36-numpy is not in TW anymore
|
||||
# Switch off test_xcb tests gh#Kozea/cairocffi#203
|
||||
python36_ignore="--ignore test_numpy.py --ignore test_xcb.py"
|
||||
%python_expand PYTHONPATH="%{buildroot}%{$python_sitelib}" xvfb-run --server-args="-screen 0 1280x1024x16" $python -m pytest ${$python_ignore}
|
||||
%python_expand PYTHONPATH="%{buildroot}%{$python_sitelib}" xvfb-run --server-args="-screen 0 1280x1024x16" $python -m pytest ${$python_ignore} -k "not test_xcb_window" *.py
|
||||
|
||||
%files %{python_files}
|
||||
%license LICENSE
|
||||
|
Loading…
Reference in New Issue
Block a user