# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-tinyhtml5
pkgver=2.0.0
pkgrel=0
pkgdesc="Tiny HTML5 parser"
url="https://github.com/CourtBouillon/tinyhtml5"
arch="all"
license="MIT"
depends="py3-webencodings"
makedepends="py3-gpep517 py3-flit-core"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/CourtBouillon/tinyhtml5/archive/$pkgver/py3-tinyhtml5-$pkgver.tar.gz"
builddir="$srcdir/tinyhtml5-$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="
6c8b367311f4a1ca39b898819fe710308e8aefcaddb2abb4fe1a0cc2ee57a8edee4da006465bbae80a3991c362e58598126d60805209d0543419efd07b3e6c5d  py3-tinyhtml5-2.0.0.tar.gz
"
