# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=py3-aioquic
pkgver=1.2.0
pkgrel=0
pkgdesc="QUIC and HTTP/3 implementation in Python"
url="https://pypi.org/project/aioquic/"
arch="all"
license="BSD-3-Clause"
depends="
	py3-certifi
	py3-cryptography
	py3-openssl
	py3-pylsqpack
	py3-service_identity
	"
makedepends="
	openssl-dev
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/aiortc/aioquic/archive/$pkgver/py3-aioquic-$pkgver.tar.gz"
builddir="$srcdir/aioquic-$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

	find "$pkgdir" -name "*.c" -delete
}

sha512sums="
6590b7986a7c436729a36a4b402d5c96d9b8740024327d95bec89d56753e95a82ce91d05480958636e72ff0c21bd1b57a1f40b5078edeaf9e0d3f26d76a479b7  py3-aioquic-1.2.0.tar.gz
"
