Subject: [alpine-aports] [PATCH 0/6] Adopt, upgrade, & normalize weasyprint et al

From: Drew DeVault <[email-masked]>
Date: Wed, 3 Apr 2019 15:11:04 -0400

Drew DeVault (6):
  testing/py3-cairosvg: adopt, upgrade to 2.3.0
  testing/py3-tinycss2: new APKBUILD
  testing/py-tinycss: remove obsolte APKBUILD
  testing/py3-cssselect2: new APKBUILD
  testing/py-cssselect: remove obsolete APKBUILD
  py3-weasyprint: adopt; upgrade to v46

 testing/py-cairosvg/APKBUILD                  | 40 -------------
 testing/py-cssselect/APKBUILD                 | 46 ---------------
 testing/py-tinycss/APKBUILD                   | 55 ------------------
 .../py-tinycss/disable-styling-checks.patch   | 33 -----------
 testing/py-weasyprint/APKBUILD                | 57 -------------------
 testing/py3-cairosvg/APKBUILD                 | 38 +++++++++++++
 testing/py3-cssselect2/APKBUILD               | 37 ++++++++++++
 testing/py3-cssselect2/tests.patch            | 24 ++++++++
 testing/py3-tinycss2/APKBUILD                 | 40 +++++++++++++
 testing/py3-weasyprint/APKBUILD               | 36 ++++++++++++
 10 files changed, 175 insertions(+), 231 deletions(-)
 delete mode 100644 testing/py-cairosvg/APKBUILD
 delete mode 100644 testing/py-cssselect/APKBUILD
 delete mode 100644 testing/py-tinycss/APKBUILD
 delete mode 100644 testing/py-tinycss/disable-styling-checks.patch
 delete mode 100644 testing/py-weasyprint/APKBUILD
 create mode 100644 testing/py3-cairosvg/APKBUILD
 create mode 100644 testing/py3-cssselect2/APKBUILD
 create mode 100644 testing/py3-cssselect2/tests.patch
 create mode 100644 testing/py3-tinycss2/APKBUILD
 create mode 100644 testing/py3-weasyprint/APKBUILD

-- 
2.21.0

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Drew DeVault <[email-masked]>
Date: Wed, 3 Apr 2019 15:11:05 -0400

Note that this required dropping python2 support and overhauling large
parts of the APKBUILD.
---
 testing/py-cairosvg/APKBUILD  | 40 -----------------------------------
 testing/py3-cairosvg/APKBUILD | 38 +++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 40 deletions(-)
 delete mode 100644 testing/py-cairosvg/APKBUILD
 create mode 100644 testing/py3-cairosvg/APKBUILD

diff --git a/testing/py-cairosvg/APKBUILD b/testing/py-cairosvg/APKBUILD
deleted file mode 100644
index 82b330bd4c..0000000000
--- a/testing/py-cairosvg/APKBUILD
+++ /dev/null
@@ -1,40 +0,0 @@
-# Contributor: 
-# Maintainer: 
-pkgname=py-cairosvg
-pkgver=0.5
-pkgrel=0
-pkgdesc="Cairo-based SVG renderer for python"
-url="http://cairosvg.org"
-arch="noarch"
-license="LGPL-3.0-or-later"
-depends="python2 py-cairocffi"
-depends_dev=""
-makedepends="python2-dev py-setuptools"
-install=""
-subpackages=""
-source="https://files.pythonhosted.org/packages/source/C/CairoSVG/CairoSVG-$pkgver.tar.gz"
-
-_builddir="$srcdir"/CairoSVG-$pkgver
-prepare() {
-	local i
-	cd "$_builddir"
-	for i in $source; do
-		case $i in
-		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
-		esac
-	done
-}
-
-build() {
-	cd "$_builddir"
-	python2 setup.py build || return 1
-}
-
-package() {
-	cd "$_builddir"
-	python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
-}
-
-md5sums="6c092cce2b2ade47054aea6657173cbf  CairoSVG-0.5.tar.gz"
-sha256sums="9aa311fb832c37bf376a4bbcf0b97beddc4527e4fbd918cdd35d42bc3200e170  CairoSVG-0.5.tar.gz"
-sha512sums="039db314effeeeb2bfae1ad47f8505742fcc160804e8f029a4f3568fbc3e9b802e785ae2cf4ec63d6dee6d4730676fa48c1d8915423ec60e5855540eaac17572  CairoSVG-0.5.tar.gz"
diff --git a/testing/py3-cairosvg/APKBUILD b/testing/py3-cairosvg/APKBUILD
new file mode 100644
index 0000000000..9bdde8fc9e
--- /dev/null
+++ b/testing/py3-cairosvg/APKBUILD
@@ -0,0 +1,38 @@
+# Maintainer: Drew DeVault <[email-masked]>
+pkgname=py3-cairosvg
+_pyname=CairoSVG
+pkgver=2.3.0
+pkgrel=0
+pkgdesc="Cairo-based SVG renderer for python"
+url="http://cairosvg.org"
+arch="noarch"
+license="LGPL-3.0-or-later"
+depends="python3 py3-tinycss2 py3-cssselect2 py3-defusedxml py3-cairocffi"
+checkdepends="py3-pytest"
+makedepends="python3-dev py3-setuptools cairo-dev"
+_pypiprefix="${_pyname%${_pyname#?}}"
+source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
+builddir="$srcdir"/CairoSVG-$pkgver
+replaces="py-cairosvg"
+
+prepare() {
+	cd "$builddir"
+	sed -i setup.cfg -e 's/--flake8//' -e 's/--isort//'
+}
+
+build() {
+	cd "$builddir"
+	python3 setup.py build
+}
+
+check() {
+	cd "$builddir"
+	pytest-3
+}
+
+package() {
+	mkdir -p "$pkgdir"
+	python3 setup.py install --prefix=/usr --root="$pkgdir"
+}
+
+sha512sums="099da421f3e3bd8b1aaf727bffe388ed08b36eb027a79e31d2fae74fe67adcb8c174763ae2bae49715369a5ab44aea1d3f50bd64895a6aac6740ddf8bebbdc54  CairoSVG-2.3.0.tar.gz"
-- 
2.21.0

---

---

From: Leonardo <[email-masked]>
Date: Fri, 5 Apr 2019 14:39:58 +0200

Hi,

>   create mode 100644 testing/py3-cairosvg/APKBUILD

looks like it wants Python Imagine Library (PIL) for running check():

E   ModuleNotFoundError: No module named 'PIL'

Thanks!

/eo

---

---

From: Drew DeVault <[email-masked]>
Date: Wed, 3 Apr 2019 15:11:06 -0400

---
 testing/py3-tinycss2/APKBUILD | 40 +++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 testing/py3-tinycss2/APKBUILD

diff --git a/testing/py3-tinycss2/APKBUILD b/testing/py3-tinycss2/APKBUILD
new file mode 100644
index 0000000000..e1e169e464
--- /dev/null
+++ b/testing/py3-tinycss2/APKBUILD
@@ -0,0 +1,40 @@
+# Contributor: Drew DeVault <[email-masked]>
+# Maintainer: Drew DeVault <[email-masked]>
+pkgname=py3-tinycss2
+_pyname=tinycss2
+pkgver=1.0.2
+pkgrel=0
+pkgdesc="Low-level CSS parser for Python"
+url="https://pypi.python.org/pypi/tinycss2"
+arch="noarch"
+license="BSD-3-Clause"
+depends="py3-webencodings"
+makedepends="python3-dev py3-setuptools py3-flake8 py3-pytest py3-pytest-cov"
+_pypiprefix="${_pyname%${_pyname#?}}"
+source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
+builddir="$srcdir"/$_pyname-$pkgver
+replaces="py-tinycss py2-tinycss py3-tinycss"
+
+prepare() {
+    cd "$builddir"
+	sed -i setup.cfg -e 's/--flake8//' -e 's/--isort//'
+	sed -i setup.cfg -e 's/pytest-flake8//' -e 's/pytest-isort//'
+}
+
+build() {
+	cd "$builddir"
+	python3 setup.py build
+}
+
+check() {
+	cd "$builddir"
+	python3 setup.py pytest
+}
+
+package() {
+	cd "$builddir"
+	mkdir -p "$pkgdir"
+	python3 setup.py install --prefix=/usr --root="$pkgdir"
+}
+
+sha512sums="69bdf52898f9e704c01fe5fd11170e0efc9a6aca14646f5331fc06ebbdf941f9b6c798ded7d93636c7b810b35c659750c3ece3917c5c9cef4092e3e17b382dd1  tinycss2-1.0.2.tar.gz"
-- 
2.21.0

---

---

From: Drew DeVault <[email-masked]>
Date: Wed, 3 Apr 2019 15:11:07 -0400

---
 testing/py-tinycss/APKBUILD                   | 55 -------------------
 .../py-tinycss/disable-styling-checks.patch   | 33 -----------
 2 files changed, 88 deletions(-)
 delete mode 100644 testing/py-tinycss/APKBUILD
 delete mode 100644 testing/py-tinycss/disable-styling-checks.patch

diff --git a/testing/py-tinycss/APKBUILD b/testing/py-tinycss/APKBUILD
deleted file mode 100644
index 29ca919e3f..0000000000
--- a/testing/py-tinycss/APKBUILD
+++ /dev/null
@@ -1,55 +0,0 @@
-# Contributor: 
-# Contributor: Stefan Wagner <[email-masked]>
-# Maintainer: 
-pkgname=py-tinycss
-_pkgname=tinycss
-pkgver=0.4
-pkgrel=0
-pkgdesc="tiny CSS parser for python"
-url="https://pythonhosted.org/tinycss"
-arch="all"
-license="BSD"
-makedepends="python2-dev python3-dev py-setuptools"
-checkdepends="pytest-cov py-configparser py-futures"
-subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
-source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
-	disable-styling-checks.patch"
-builddir="$srcdir"/$_pkgname-$pkgver
-
-build() {
-	cd "$builddir"
-	python2 setup.py build
-	python3 setup.py build
-}
-
-check() {
-	cd "$builddir"
-	python2 setup.py test
-	python3 setup.py test
-}
-
-package() {
-	mkdir -p "$pkgdir"
-}
-
-_py2() {
-	replaces="$pkgname"
-	_py python2
-}
-
-_py3() {
-	_py python3
-}
-
-_py() {
-	local python="$1"
-	pkgdesc="$pkgdesc (for $python)"
-	depends="$depends $python"
-	install_if="$pkgname=$pkgver-r$pkgrel $python"
-
-	cd "$builddir"
-	$python setup.py install --prefix=/usr --root="$subpkgdir"
-}
-
-sha512sums="13a50332cddc28026fd7ecc007e14085976284e69de6ea93d1013502fd9791694092c010947b13dcd23f3a2df65f277f62410abd90d03eac16fa5af913673b0a  tinycss-0.4.tar.gz
-8265e4c9e52fb8ae3f3041333aea46c3702e3657892a957db2117615d16b446bcadb96601fe0b8197d921997433b1a0e06a77a10ce74095687c59ed00f766def  disable-styling-checks.patch"
diff --git a/testing/py-tinycss/disable-styling-checks.patch b/testing/py-tinycss/disable-styling-checks.patch
deleted file mode 100644
index bcc039e2f5..0000000000
--- a/testing/py-tinycss/disable-styling-checks.patch
+++ /dev/null
@@ -1,33 +0,0 @@
---- a/setup.cfg
-+++ b/setup.cfg
-@@ -9,7 +9,7 @@
- test = pytest
- 
- [tool:pytest]
--addopts = --flake8 --isort --cov --ignore=test/cairosvg_reference
-+addopts = --cov --ignore=test/cairosvg_reference
- norecursedirs = dist .cache .git build *.egg-info .eggs venv cairosvg_reference
- flake8-ignore = docs/conf.py ALL
- isort_ignore = 
---- a/setup.py
-+++ b/setup.py
-@@ -99,9 +99,9 @@
-         ],
-         setup_requires=pytest_runner,
-         tests_require=[
--            'pytest-cov', 'pytest-flake8', 'pytest-isort', 'pytest-runner'],
-+            'pytest-cov', 'pytest-runner'],
-         extras_require={'test': (
--            'pytest-runner', 'pytest-cov', 'pytest-flake8', 'pytest-isort')},
-+            'pytest-runner', 'pytest-cov')},
-         packages=['tinycss', 'tinycss.tests'],
-         **kwargs
-     )
---- a/tinycss.egg-info/requires.txt
-+++ b/tinycss.egg-info/requires.txt
-@@ -2,5 +2,3 @@
- [test]
- pytest-runner
- pytest-cov
--pytest-flake8
--pytest-isort
-- 
2.21.0

---

---

From: Drew DeVault <[email-masked]>
Date: Wed, 3 Apr 2019 15:11:08 -0400

---
 testing/py3-cssselect2/APKBUILD    | 37 ++++++++++++++++++++++++++++++
 testing/py3-cssselect2/tests.patch | 24 +++++++++++++++++++
 2 files changed, 61 insertions(+)
 create mode 100644 testing/py3-cssselect2/APKBUILD
 create mode 100644 testing/py3-cssselect2/tests.patch

diff --git a/testing/py3-cssselect2/APKBUILD b/testing/py3-cssselect2/APKBUILD
new file mode 100644
index 0000000000..cff5c231cb
--- /dev/null
+++ b/testing/py3-cssselect2/APKBUILD
@@ -0,0 +1,37 @@
+# Contributor: Drew DeVault <[email-masked]>
+# Maintainer: Drew DeVault <[email-masked]>
+pkgname=py3-cssselect2
+_pyname=cssselect2
+pkgver=0.2.1
+pkgrel=0
+pkgdesc="CSS selectors for Python ElementTree"
+url="https://pypi.org/projects/cssselect2/"
+arch="noarch"
+license="BSD-3-Clause"
+depends="py3-tinycss2"
+makedepends="python3-dev py3-setuptools py3-tinycss2 py3-pytest py3-pytest-cov"
+_pypiprefix="${_pyname%${_pyname#?}}"
+source="
+	https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz
+	tests.patch
+"
+builddir="$srcdir"/$_pyname-$pkgver
+
+build() {
+	cd "$builddir"
+	python3 setup.py build
+}
+
+check() {
+	cd "$builddir"
+	python3 setup.py pytest
+}
+
+package() {
+	cd "$builddir"
+	mkdir -p "$pkgdir"
+	python3 setup.py install --prefix=/usr --root="$pkgdir"
+}
+
+sha512sums="88490de859175e1cba84257e8ebb6618b388f24f0e121195a013e74c783a5aef0c2aed002eb1a46512392e988b4014824f547bd3c55c645e8c30ad62dd8c1a14  cssselect2-0.2.1.tar.gz
+9300b2ed735ec35caec7c2330c7649527628c7bc894557b8c0d01c613a50cd846f7b186aff04a58d1ee720016aa605be17e9c1fec7801785972d9aa5f4604a5f  tests.patch"
diff --git a/testing/py3-cssselect2/tests.patch b/testing/py3-cssselect2/tests.patch
new file mode 100644
index 0000000000..cea4ca7c10
--- /dev/null
+++ b/testing/py3-cssselect2/tests.patch
@@ -0,0 +1,24 @@
+--- cssselect2-0.2.1-orig/setup.cfg
++++ cssselect2-0.2.1/setup.cfg
+@@ -5,7 +5,7 @@
+ universal = 1
+ 
+ [tool:pytest]
+-addopts = --cov=cssselect2 --flake8 --isort cssselect2
++addopts = --cov=cssselect2 cssselect2
+ norecursedirs = dist .cache .git build *.egg-info .eggs venv
+ 
+ [egg_info]
+--- cssselect2-0.2.1-orig/setup.py
++++ cssselect2-0.2.1/setup.py
+@@ -29,8 +29,6 @@
+     install_requires=['tinycss2'],
+     setup_requires=pytest_runner,
+     test_suite='cssselect2.tests',
+-    tests_require=[
+-        'pytest-runner', 'pytest-cov', 'pytest-flake8', 'pytest-isort'],
+-    extras_require={'test': [
+-        'pytest-runner', 'pytest-cov', 'pytest-flake8', 'pytest-isort']},
++    tests_require=['pytest-runner', 'pytest-cov'],
++    extras_require={'test': ['pytest-runner', 'pytest-cov']},
+ )
-- 
2.21.0

---

---

From: Drew DeVault <[email-masked]>
Date: Wed, 3 Apr 2019 15:11:09 -0400

---
 testing/py-cssselect/APKBUILD | 46 -----------------------------------
 1 file changed, 46 deletions(-)
 delete mode 100644 testing/py-cssselect/APKBUILD

diff --git a/testing/py-cssselect/APKBUILD b/testing/py-cssselect/APKBUILD
deleted file mode 100644
index 1d261c5fbb..0000000000
--- a/testing/py-cssselect/APKBUILD
+++ /dev/null
@@ -1,46 +0,0 @@
-# Contributor: Francesco Colista <[email-masked]>
-# Maintainer: Francesco Colista <[email-masked]>
-pkgname=py-cssselect
-_pkgname=cssselect
-pkgver=1.0.0
-pkgrel=1
-pkgdesc="A Python library that parses CSS3 Selectors and translates them to XPath 1.0"
-url="http://pypi.python.org/pypi/cssselect"
-arch="noarch"
-license="BSD"
-makedepends="python2-dev python3-dev py-setuptools"
-subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2"
-source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
-builddir="$srcdir"/$_pkgname-$pkgver
-
-build() {
-	cd "$builddir"
-	python2 setup.py build || return 1
-	python3 setup.py build || return 1
-}
-
-package() {
-	mkdir -p "$pkgdir"
-}
-
-
-_py() {
-	local python=$1
-	pkgdesc="$pkgdesc - $python"
-	install_if="$pkgname=$pkgver-r$pkgrel $python"
-	cd "$builddir"
-	$python setup.py install --prefix=/usr --root="$subpkgdir"
-}
-
-_py2() {
-	_py python2
-	replaces="$pkgname"
-}
-
-_py3() {
-	_py python3
-}
-
-md5sums="9776aa9f552d830fac45aa979610b406  cssselect-1.0.0.tar.gz"
-sha256sums="582a85780249255707872c31d0438fc457aa24cfb43e472ff8f3e7ad6857953f  cssselect-1.0.0.tar.gz"
-sha512sums="59b8ed898a2f5286f3d1be5b9bf2486f0b0cc372271d34098dbbc95696eb951bbb52e53810f9e20f0aab8e2a26c4eaf1905e1604f85287965bd4d105bb4b71fb  cssselect-1.0.0.tar.gz"
-- 
2.21.0

---

---

From: Drew DeVault <[email-masked]>
Date: Wed, 3 Apr 2019 15:11:10 -0400

---
 testing/py-weasyprint/APKBUILD  | 57 ---------------------------------
 testing/py3-weasyprint/APKBUILD | 36 +++++++++++++++++++++
 2 files changed, 36 insertions(+), 57 deletions(-)
 delete mode 100644 testing/py-weasyprint/APKBUILD
 create mode 100644 testing/py3-weasyprint/APKBUILD

diff --git a/testing/py-weasyprint/APKBUILD b/testing/py-weasyprint/APKBUILD
deleted file mode 100644
index 364466c78e..0000000000
--- a/testing/py-weasyprint/APKBUILD
+++ /dev/null
@@ -1,57 +0,0 @@
-# Contributor: 
-# Maintainer: 
-pkgname=py-weasyprint
-_pkgname=WeasyPrint
-pkgver=0.42.3
-pkgrel=0
-pkgdesc="cairo-based HTML renderer for python"
-url="http://weasyprint.org"
-arch="noarch"
-license="LGPL"
-depends="pango cairo py-cairocffi py-cairosvg py-cssselect py-tinycss py-pyphen py-lxml"
-subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
-makedepends="python2-dev python3-dev py-setuptools"
-source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
-builddir="$srcdir"/$_pkgname-$pkgver
-
-prepare() {
-	cp -r "$builddir" "$builddir"-py3
-}
-
-build() {
-	cd "$builddir"
-	python2 setup.py build
-	cd "$builddir"-py3
-	python3 setup.py build
-}
-
-check() {
-	cd "$builddir"
-	python2 setup.py check
-	cd "$builddir"-py3
-	python3 setup.py check
-}
-
-package() {
-	mkdir -p "$pkgdir"
-}
-
-_py2() {
-	cd "$builddir"
-	_py python2
-}
-
-_py3() {
-	cd "$builddir"-py3
-	_py python3
-}
-
-_py() {
-	local python="$1"
-	pkgdesc="$pkgdesc (for $python)"
-	depends="$python"
-	install_if="$pkgname=$pkgver-r$pkgrel $python"
-	$python setup.py install --prefix=/usr --root="$subpkgdir"
-}
-
-sha512sums="d6007934c301904308bd4821626d6a7bb504268c5c71a31f7486faebb3dd649fad18774737cab39eb13a0916635bb58eba2c8432c72cc5a461cea2a5d874b1ee  WeasyPrint-0.42.3.tar.gz"
diff --git a/testing/py3-weasyprint/APKBUILD b/testing/py3-weasyprint/APKBUILD
new file mode 100644
index 0000000000..663c4ec62b
--- /dev/null
+++ b/testing/py3-weasyprint/APKBUILD
@@ -0,0 +1,36 @@
+# Maintainer: Drew DeVault <[email-masked]>
+pkgname=py3-weasyprint
+_pyname=WeasyPrint
+pkgver=46
+pkgrel=0
+pkgdesc="cairo-based HTML renderer for python"
+url="http://weasyprint.org"
+arch="noarch"
+license="LGPL"
+depends="
+	pango cairo py3-cairocffi py3-cairosvg py3-cssselect2 py3-tinycss2 py3-pyphen
+	py3-lxml py3-pdfrw
+"
+makedepends="python3-dev py-setuptools"
+_pypiprefix="${_pyname%${_pyname#?}}"
+source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
+builddir="$srcdir"/$_pyname-$pkgver
+replaces="py-weasyprint py2-weasyprint"
+
+build() {
+	cd "$builddir"
+	python3 setup.py build
+}
+
+check() {
+	cd "$builddir"
+	python3 setup.py check
+}
+
+package() {
+	cd "$builddir"
+	mkdir -p "$pkgdir"
+	python3 setup.py install --prefix=/usr --root="$pkgdir"
+}
+
+sha512sums="ad7c231458ca3dc08d7816bd5710469fac094b08c5202b99f54da660ecea8367509bc938be752088a2e1639d9d87137b0afb82bdf74f272adb7d88c7b8790d8b  WeasyPrint-46.tar.gz"
-- 
2.21.0

---