Patches for aports can be sent to this list

1

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

Details
Message ID
<20180120152027.16696-1-sir@cmpwn.com>
Sender timestamp
1516461627
DKIM signature
missing
Download raw message
Patch: +14 -3
---
 testing/py-anyjson/APKBUILD | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/testing/py-anyjson/APKBUILD b/testing/py-anyjson/APKBUILD
index 4641a62508..59475e74e1 100644
--- a/testing/py-anyjson/APKBUILD
+++ b/testing/py-anyjson/APKBUILD
@@ -8,17 +8,28 @@ pkgdesc="Wraps the best available JSON implementation available in a common inte
 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:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Leonardo Arena
Details
Message ID
<CAGG_d8C3_Z1sUzXzMoYxkG58y1tW6KU5xkPo47QfBLdhESoFaA@mail.gmail.com>
In-Reply-To
<20180120152027.16696-1-sir@cmpwn.com> (view parent)
Sender timestamp
1539266537
DKIM signature
missing
Download raw message
Hi,

On Sat, Jan 20, 2018 at 4:21 PM Drew DeVault <sir@cmpwn.com> wrote:

> ---
>  testing/py-anyjson/APKBUILD | 17 ++++++++++++++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
>
>
it fails here with:

ImportError while importing test module
'/home/larena/aports/testing/py-anyjson/src/anyjson-0.3.3-py3/tests/test_implementations.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_implementations.py:2: in <module>
    import anyjson
E   ModuleNotFoundError: No module named 'anyjson'

Thanks!

/eo