# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-branca
_pkgorig=branca
pkgver=0.8.0
pkgrel=0
pkgdesc="Generate complex HTML+JS pages with Python"
url="https://github.com/python-visualization/branca"
arch="noarch"
license="MIT"
depends="python3 py3-jinja2"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/python-visualization/branca/archive/v$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$pkgver"
options="!check" # disable for now - several test dependencies are missing

build() {
	SETUPTOOLS_SCM_PRETEND_VERSION="$pkgver" \
	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 -k 'not test_iframe'
}

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

sha512sums="
b5e8ac51a5d1b70ee72066ee16c9fc8d37623ca807c67cf0f5a2daba37f901ecd9eb81b03857c222ace1f36fb71a9a348aae7079deccf657eaabcc1dc6b64158  branca-0.8.0.tar.gz
"
