diff --git a/community/py-argh/APKBUILD b/community/py-argh/APKBUILD
index 90a42df69774529c30686964a3219dd41c837d3f..3898428f2c6862ae483114449836b40b5d1330b1 100644
--- a/community/py-argh/APKBUILD
+++ b/community/py-argh/APKBUILD
@@ -3,16 +3,16 @@
 pkgname=py-argh
 _pkgname=argh
 pkgver=0.26.2
-pkgrel=1
+pkgrel=2
 pkgdesc="A Python argparse wrapper"
-url="https://github.com/neithere/argh/"
+url="https://github.com/neithere/argh"
 arch="noarch"
 license="LGPL-3.0-or-later"
-depends="python2"
+depends=""
 depends_dev=""
-makedepends="python2-dev py-setuptools"
+makedepends="py-setuptools python2-dev python3-dev"
 install=""
-subpackages=""
+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"
@@ -20,16 +20,36 @@ 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"
-	python2 setup.py install --prefix=/usr --root="$pkgdir"
+	$python setup.py install --prefix=/usr --root="$subpkgdir"
 }
 
 sha512sums="90382900d5cec9629dacb4459a2c9491d1425b66fa3f90d7cbf511dec846a99dbb9424f3e08f0c006da48fbf9c067078705be70b314700541fd800630e4b1707  argh-0.26.2.tar.gz"