diff --git a/main/graphviz/APKBUILD b/main/graphviz/APKBUILD
index 832f14afbe138ac669fe10573ad11e056c0e5723..424966bfee300493e8498061efd98517df53aef3 100644
--- a/main/graphviz/APKBUILD
+++ b/main/graphviz/APKBUILD
@@ -16,7 +16,7 @@ makedepends="$depends_dev flex swig python2-dev m4 libtool
 	bison gtk+2.0-dev lua$_luaver-dev libltdl tcl autoconf automake"
 install="$pkgname.pre-deinstall"
 triggers="$pkgname.trigger=/usr/lib/graphviz"
-subpackages="$pkgname-dev $pkgname-doc py-gv:py lua$_luaver-$pkgname:_lua
+subpackages="$pkgname-dev $pkgname-doc py2-gv:py lua$_luaver-$pkgname:_lua
 	$pkgname-gtk $pkgname-graphs::noarch"
 source="$pkgname-$pkgver.tar.bz2::https://gitlab.com/graphviz/$pkgname/repository/stable_release_$pkgver/archive.tar.bz2
 	$pkgname.trigger
@@ -94,7 +94,10 @@ package() {
 }
 
 py() {
-	pkgdesc="Python extension for graphviz"
+	pkgdesc="Python2 extension for graphviz"
+	depends="python2"
+	provides="py-$pkgname=$pkgver-r$pkgrel"  # for backward compatibility
+	replaces="py-$pkgname"  # for backward compatibility
 
 	mkdir -p "$subpkgdir"/usr/lib/graphviz \
 		"$subpkgdir"/usr/lib