# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=py3-branca
_pkgorig=branca
pkgver=0.8.1
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="
70b5a8f7da69dfdf9195d3b9f7e70510a1b6cb199224b8583190aa20bb1699bed9b77c31d34dd365dbae5ef0c32f67baaaf20a2546c11203b7140c3d80f3dd2e  branca-0.8.1.tar.gz
"
