From e7e911f0d113721253c09dfa7c8c17bd3d333053 Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Nov 30 2019 23:48:08 +0000 Subject: update to new upstream version 50 + run tests in %check --- diff --git a/.gitignore b/.gitignore index 166ad32..822355a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /v0.22.tar.gz /weasyprint-0.22.tar.gz /weasyprint-0.39.tar.gz +/WeasyPrint-50.tar.gz diff --git a/sources b/sources index 6552f83..91c30c8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (weasyprint-0.39.tar.gz) = b9c30037c426322615d8dee61ee7226ed0a28c51383b2f5543cc3bf1a22a0f2dc306efb95736b69e7a3ba22e2d869b7b7485ae9cc960fbc5a8c2ff3b387ceb1a +SHA512 (WeasyPrint-50.tar.gz) = b637e97eb26318f7a12e1fecaa1c4683fcc0f6dc61c7d207c71437f322f51a17edab788f4595aa2923691e1bdde18d622073b453f08ee6eef49f9e97a55cc6af diff --git a/weasyprint-0.39-shebang.patch b/weasyprint-0.39-shebang.patch deleted file mode 100644 index 508e1e2..0000000 --- a/weasyprint-0.39-shebang.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -up WeasyPrint-0.39/setup.py.shebang WeasyPrint-0.39/setup.py ---- WeasyPrint-0.39/setup.py.shebang 2017-06-24 06:17:13.000000000 -0600 -+++ WeasyPrint-0.39/setup.py 2019-04-30 11:35:39.332841176 -0600 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/python33 - # coding: utf-8 - - """ -diff -up WeasyPrint-0.39/weasyprint.py.shebang WeasyPrint-0.39/weasyprint.py ---- WeasyPrint-0.39/weasyprint.py.shebang 2019-04-30 11:37:57.246833547 -0600 -+++ WeasyPrint-0.39/weasyprint.py 2019-04-30 11:38:06.906833013 -0600 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/python3 - from weasyprint.__main__ import main - - if __name__ == '__main__': -diff -up WeasyPrint-0.39/weasyprint/tests/test_web/run.py.shebang WeasyPrint-0.39/weasyprint/tests/test_web/run.py ---- WeasyPrint-0.39/weasyprint/tests/test_web/run.py.shebang 2019-04-30 11:38:19.879832296 -0600 -+++ WeasyPrint-0.39/weasyprint/tests/test_web/run.py 2019-04-30 11:38:28.852831799 -0600 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/python3 - # coding: utf-8 - """ - weasyprint.tests.test_web.run diff --git a/weasyprint-disable-flake8-isort-for-pytest.patch b/weasyprint-disable-flake8-isort-for-pytest.patch new file mode 100644 index 0000000..c7a23f5 --- /dev/null +++ b/weasyprint-disable-flake8-isort-for-pytest.patch @@ -0,0 +1,30 @@ +diff --git a/setup.cfg b/setup.cfg +index 1e88b56..62725f6 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -52,8 +52,6 @@ install_requires = + tests_require = + pytest-runner + pytest-cov +- pytest-flake8 +- pytest-isort + python_requires = >= 3.5 + + [options.entry_points] +@@ -71,8 +69,6 @@ doc = + test = + pytest-runner + pytest-cov +- pytest-flake8 +- pytest-isort + + [bdist_wheel] + python-tag = py3 +@@ -85,7 +81,6 @@ build-dir = docs/_build + test = pytest + + [tool:pytest] +-addopts = --flake8 --isort + norecursedirs = build dist .cache .eggs .git + + [coverage:run] diff --git a/weasyprint.spec b/weasyprint.spec index 0520226..a6933f2 100644 --- a/weasyprint.spec +++ b/weasyprint.spec @@ -1,36 +1,69 @@ +%global modname weasyprint +%global srcname WeasyPrint + Name: weasyprint -Version: 0.39 -Release: 5%{?dist} +Version: 50 +Release: 1%{?dist} Summary: Utility to render HTML and CSS to PDF + License: BSD -URL: http://weasyprint.org/ -BuildArch: noarch +URL: https://weasyprint.org/ Source0: %pypi_source +Patch0: %{name}-disable-flake8-isort-for-pytest.patch -Requires: python3-weasyprint = %{version}-%{release} -BuildRequires: python3-devel python3-setuptools +BuildArch: noarch + +BuildRequires: python3-devel +# 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 +# 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: /usr/bin/pathfix.py +# 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 + +Requires: python3-weasyprint = %{version}-%{release} + + %description WeasyPrint can render HTML and CSS to PDF. It aims to support web standards for printing. %package -n python3-weasyprint Summary: Python library to render HTML and CSS to PDF -Requires: hyphen -Requires: pango -Requires: python3-cairocffi >= 0.5 -Requires: python3-cairosvg >= 0.4.1 -Requires: python3-cssselect >= 0.6 -Requires: python3-html5lib >= 0.999 -Requires: python3-lxml >= 3.0 -Requires: python3-pyphen >= 0.8 -Requires: python3-setuptools -Requires: python3-tinycss2 >= 0.5 +Requires: cairo >= 1.15.4 +Requires: pango >= 1.38.0 +Requires: gdk-pixbuf2 >= 2.25.0 # workaround for bug 1685654 # actually python3-cairocffi should have that dependency (see bug 1698217) but # for now just add the requirement here. Requires: python3-xcffib +# 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 # that might be useful: @@ -49,25 +82,30 @@ pathfix.py -pni "%{__python3} %{py3_shbang_opts}" . %build %py3_build -# do not ship tests -rm -rf weasyprint/tests %install %py3_install -chmod +x %{buildroot}%{python3_sitelib}/weasyprint/tests/test_web/run.py + +%check +%{__python3} setup.py test +# do not ship tests +rm -rf %{buildroot}%{python3_sitelib}/%{modname}/tests %files %license LICENSE -%doc AUTHORS CHANGES README.rst +%doc README.rst %{_bindir}/weasyprint %files -n python3-weasyprint %license LICENSE -%doc AUTHORS CHANGES README.rst -%{python3_sitelib}/WeasyPrint-*/ -%{python3_sitelib}/weasyprint/ +%doc README.rst +%{python3_sitelib}/%{srcname}-%{version}-*/ +%{python3_sitelib}/%{modname}/ %changelog +* Sun Dec 01 2019 Felix Schwarz 50-1 +- update to new upstream version + * Thu Oct 03 2019 Miro Hrončok - 0.39-5 - Rebuilt for Python 3.8.0rc1 (#1748018)