# Contributor: Russ Webber <russ@rw.id.au>
# Maintainer: Russ Webber <russ@rw.id.au>
pkgname=py3-pydot
pkgver=3.0.2
pkgrel=0
pkgdesc="Python interface to Graphviz's Dot language"
url="https://github.com/pydot/pydot"
arch="noarch"
license="MIT"
depends="python3 py3-parsing"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-chardet graphviz"
subpackages="$pkgname-pyc"
source="https://github.com/pydot/pydot/archive/v$pkgver/pydot-v$pkgver.tar.gz"
options="!check" # graphviz unable to parse jpe files
builddir="$srcdir/pydot-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
b24b2073781b6c3256e3d9e76514193493d8a8d9eadc8ef1db3d13b7c4d3ddbdcfcc008b3b70abbe9dcb11d2036b4b3a3dda6ca13277fb5413f699a136a58b80  pydot-v3.0.2.tar.gz
"
