diff --git a/.gitignore b/.gitignore index cc7512a..cfeed4c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /WeasyPrint-*.tar.gz /*.src.rpm /results_weasyprint +/weasyprint-53.0.tar.gz diff --git a/sources b/sources index 638c0ad..e9f605f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (WeasyPrint-52.5.tar.gz) = 0ce86db000adef95fabfb335c069ad2a602ed98056219cedde905c550b04b10b0881d72fbdd38a48fae4e263825f5fbd8a70ce13932083afb8930eacc5817fb5 +SHA512 (weasyprint-53.0.tar.gz) = de34ee5654ee90aec82b67c1bc7d9496fe3a4247b2a649ab110d1613c4780fd9ae611c9da177de07e5287749978af9a4a7d5c102d0940e5fd970e5aa8586c47e diff --git a/weasyprint-cairo-1174-pdf-dates.patch b/weasyprint-cairo-1174-pdf-dates.patch deleted file mode 100644 index 9ce64a2..0000000 --- a/weasyprint-cairo-1174-pdf-dates.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/weasyprint/tests/test_pdf.py b/weasyprint/tests/test_pdf.py -index 287bcb7..11cf6d9 100644 ---- a/weasyprint/tests/test_pdf.py -+++ b/weasyprint/tests/test_pdf.py -@@ -651,8 +651,8 @@ def test_document_info(): - assert info.get_value('Keywords', '(.*)') == b'(html, css, pdf)' - assert info.get_value('Subject', '(.*)') == ( - b'') -- assert info.get_value('CreationDate', '(.*)') == b"(20110421230000+00'00)" -- assert info.get_value('ModDate', '(.*)') == b"(20130721234600+01'00)" -+ assert info.get_value('CreationDate', '(.*)') == b"(20110421230000+00'00')" -+ assert info.get_value('ModDate', '(.*)') == b"(20130721234600+01'00')" - - - @assert_no_logs diff --git a/weasyprint-disable-flake8-isort-for-pytest.patch b/weasyprint-disable-flake8-isort-for-pytest.patch index c4a33e3..1523b96 100644 --- a/weasyprint-disable-flake8-isort-for-pytest.patch +++ b/weasyprint-disable-flake8-isort-for-pytest.patch @@ -1,30 +1,13 @@ -diff --git a/setup.cfg b/setup.cfg -index 2afc3e2..170991f 100644 ---- a/setup.cfg -+++ b/setup.cfg -@@ -61,8 +61,6 @@ install_requires = - tests_require = - pytest-runner - pytest-cov -- pytest-flake8 -- pytest-isort - python_requires = >= 3.6 - - [options.entry_points] -@@ -80,8 +78,6 @@ doc = - test = - pytest-runner - pytest-cov -- pytest-flake8 -- pytest-isort - - [bdist_wheel] - python-tag = py3 -@@ -94,7 +90,6 @@ build-dir = docs/_build - test = pytest - - [tool:pytest] --addopts = --flake8 --isort - norecursedirs = build dist .cache .eggs .git - - [coverage:run] +diff --git a/pyproject.toml b/pyproject.toml +index b7564a4..303fef2 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -61,7 +61,7 @@ weasyprint = 'weasyprint.__main__:main' + exclude = ['.*', 'tests/results'] + + [tool.pytest.ini_options] +-addopts = '--isort --flake8 --cov --no-cov-on-fail' ++addopts = '--cov --no-cov-on-fail' + + [tool.coverage.run] + branch = true diff --git a/weasyprint-remove-dependency-coverage-toml.patch b/weasyprint-remove-dependency-coverage-toml.patch new file mode 100644 index 0000000..bb0ff2d --- /dev/null +++ b/weasyprint-remove-dependency-coverage-toml.patch @@ -0,0 +1,13 @@ +diff --git a/pyproject.toml b/pyproject.toml +index 899e7a6..888daa9 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -52,7 +52,7 @@ Donation = 'https://opencollective.com/courtbouillon' + + [project.optional-dependencies] + doc = ['sphinx', 'sphinx_rtd_theme'] +-test = ['pytest', 'pytest-cov', 'pytest-flake8', 'pytest-isort', 'coverage[toml]'] ++test = ['pytest', 'pytest-cov', 'pytest-flake8', 'pytest-isort'] + + [project.scripts] + weasyprint = 'weasyprint.__main__:main' diff --git a/weasyprint.spec b/weasyprint.spec index db559c9..91c60bd 100644 --- a/weasyprint.spec +++ b/weasyprint.spec @@ -1,52 +1,29 @@ %global modname weasyprint -%global srcname WeasyPrint +%global srcname weasyprint Name: weasyprint -Version: 52.5 -Release: 3%{?dist} +Version: 53.0 +Release: 1%{?dist} Summary: Utility to render HTML and CSS to PDF License: BSD URL: https://weasyprint.org/ Source0: %pypi_source Patch0: %{name}-disable-flake8-isort-for-pytest.patch -# cairo creates PDFs according to the PDF 1.4 specification which requires a -# trailing apostrophe. cairo 1.17.4 added the missing apostrophe. -# see also https://gitlab.freedesktop.org/cairo/cairo/-/issues/450 -Patch1: %{name}-cairo-1174-pdf-dates.patch +Patch1: %{name}-remove-dependency-coverage-toml.patch BuildArch: noarch BuildRequires: python3-devel -BuildRequires: python3-pillow >= 4.0.0 -# upstream installation docs say: -# "setuptools ≥ 30.3.0 is required to install WeasyPrint from wheel, -# but 39.2.0 is required to build the package or install from source." -BuildRequires: python3-setuptools >= 39.2.0 -BuildRequires: python3-pytest -BuildRequires: python3-pytest-cov -BuildRequires: python3-pytest-runner -BuildRequires: /usr/bin/pathfix.py - +BuildRequires: pyproject-rpm-macros +# used as "build-backend" in pyproject.toml but not detected by Fedora's +# macros to generate build requirements +BuildRequires: python3-flit # requirements for testing -BuildRequires: cairo >= 1.15.4 -BuildRequires: dejavu-sans-fonts -BuildRequires: gdk-pixbuf2 >= 2.25.0 -BuildRequires: gdk-pixbuf2-modules -# gdk-pixbuf2 does not require libjpeg directly but tests try to load jpg -# images via gdk-pixbuf2 -BuildRequires: libjpeg-turbo -BuildRequires: pango >= 1.38.0 -BuildRequires: python3-cairosvg >= 2.4.0 -BuildRequires: python3-cssselect2 >= 0.1 -BuildRequires: python3-cairocffi >= 0.9.0 -BuildRequires: python3-html5lib >= 0.999999999 -# upstream requires > 0.9.1 (actually >= 0.8, != 0.9.1), see -# https://github.com/Kozea/WeasyPrint/pull/989#issuecomment-551845041 -# We need pyhen's hyphenation dicts (instead of system-wide dicts) otherwise -# there will be test failures. -BuildRequires: python3-pyphen > 0.9.1 -BuildRequires: python3-tinycss2 >= 1.0 +BuildRequires: dejavu-fonts-all +BuildRequires: ghostscript +# https://doc.courtbouillon.org/weasyprint/latest/first_steps.html +BuildRequires: pango >= 1.44.0 Requires: python3-weasyprint = %{version}-%{release} @@ -57,9 +34,7 @@ for printing. %package -n python3-weasyprint Summary: Python library to render HTML and CSS to PDF -Requires: cairo >= 1.15.4 -Requires: pango >= 1.38.0 -Requires: gdk-pixbuf2 >= 2.25.0 +Requires: pango >= 1.44.0 # other Python dependencies will be picked up automatically # Weasyprint will fail if no fonts are installed. There's no way to know # what fonts the user would actually want, but require a few common ones @@ -73,23 +48,19 @@ The WeasyPrint Python library is a rendering engine for HTML and CSS that can export to PDF. It aims to support web standards for printing. %prep -%autosetup -p1 -n WeasyPrint-%{version} -pathfix.py -pni "%{__python3} %{py3_shbang_opts}" . +%autosetup -p1 -n %{srcname}-%{version} + +%generate_buildrequires +%pyproject_buildrequires -r -x test %build -%py3_build +%pyproject_wheel %install -%py3_install +%pyproject_install %check -# Some tests fail due to cairo 1.17.4 but upstream is not interested in fixing -# these as they are moving away from cairo. At the same time there was some -# indication on the WeasyPrint mailing list that the actual issue is already -# present with WeasyPrint 1.16 (just not in the test suite). -# I hope to fix this anyway but for now disable the failing tests. -# Upstream tracking issue: https://github.com/Kozea/WeasyPrint/issues/1291 -pytest-3 -k "not test_text and not test_float and not test_table_vertical_align" +pytest-3 # do not ship tests rm -rf %{buildroot}%{python3_sitelib}/%{modname}/tests @@ -101,10 +72,13 @@ rm -rf %{buildroot}%{python3_sitelib}/%{modname}/tests %files -n python3-weasyprint %license LICENSE %doc README.rst -%{python3_sitelib}/%{srcname}-%{version}-*/ +%{python3_sitelib}/%{modname}-%{version}.dist-info/ %{python3_sitelib}/%{modname}/ %changelog +* Sun Aug 01 2021 Felix Schwarz - 53.0-1 +- update to 53.0 + * Fri Jul 23 2021 Fedora Release Engineering - 52.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild