# Contributor: Antoine Fontaine <antoine.fontaine@epfl.ch>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-hpack
pkgver=4.0.0
pkgrel=9
pkgdesc="HTTP/2 framing layer for Python"
url="https://python-hyper.org/projects/hpack/en/latest/"
arch="noarch"
license="MIT"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
checkdepends="py3-pytest py3-hypothesis"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/h/hpack/hpack-$pkgver.tar.gz"
builddir="$srcdir/hpack-$pkgver"
options="!check" # missing test fixtures

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

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest test
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
7a303d00176288cefb4b9c562aad8d15f4e15865d6f6c8c8a086cc2ebf605547c5b2ca0498ba24d758f0a9e37877b585de1b55b232eae271b9eaf2d1238106ca  hpack-4.0.0.tar.gz
"
