Subject: [alpine-aports] [PATCHv2] testing/py-anyjson: fix python 3 support

From: Drew DeVault <[email-masked]>
Date: Sat, 20 Jan 2018 11:44:27 -0500

---
Last one with the forgotten pkgrel, sorry.

 testing/py-anyjson/APKBUILD | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/testing/py-anyjson/APKBUILD b/testing/py-anyjson/APKBUILD
index 4641a62508..1305319f0e 100644
--- a/testing/py-anyjson/APKBUILD
+++ b/testing/py-anyjson/APKBUILD
@@ -3,22 +3,33 @@
 pkgname=py-anyjson
 _pkgname=anyjson
 pkgver=0.3.3
-pkgrel=1
+pkgrel=2
 pkgdesc="Wraps the best available JSON implementation available in a common interface"
 url="https://bitbucket.org/runeh/anyjson/"
 arch="noarch"
 license="BSD"
-makedepends="python2-dev python3-dev py-setuptools"
+makedepends="python2-dev python3-dev py-setuptools py3-nose py3-pytest"
 subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
 source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
 builddir="$srcdir"/$_pkgname-$pkgver
 
+prepare() {
+	cd "$srcdir"
+	cp -R "$_pkgname-$pkgver" "$_pkgname-$pkgver"-py3
+}
+
 build() {
 	cd "$builddir"
 	python2 setup.py build || return 1
+	cd "$builddir"-py3
 	python3 setup.py build || return 1
 }
 
+check() {
+	cd "$builddir"-py3
+	pytest-3
+}
+
 package() {
 	mkdir -p "$pkgdir"
 }
@@ -26,11 +37,13 @@ package() {
 _py2() {
 	replaces="$pkgname"
 	depends="${depends//py-/py2-}"
+	cd "$builddir"
 	_py python2
 }
 
 _py3() {
 	depends="${depends//py-/py3-}"
+	cd "$builddir"-py3
 	_py python3
 }
 
@@ -39,8 +52,6 @@ _py() {
 	pkgdesc="$pkgdesc (for $python)"
 	depends="$depends $python"
 	install_if="$pkgname=$pkgver-r$pkgrel $python"
-
-	cd "$builddir"
 	$python setup.py install --prefix=/usr --root="$subpkgdir"
 }
 
-- 
2.15.0

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