# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-daphne
_pkgreal=daphne
pkgver=4.2.1
pkgrel=0
pkgdesc="HTTP, HTTP2 and WebSocket protocol server for ASGI and ASGI-HTTP"
url="https://github.com/django/daphne"
arch="noarch"
license="BSD-3-Clause"
depends="
	py3-twisted
	py3-autobahn
	py3-asgiref
"
checkdepends="
	py3-hypothesis
	py3-django
	py3-cryptography
	py3-pytest
	py3-pytest-asyncio
	py3-pytest-runner
"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/django/daphne/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir"/$_pkgreal-$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 -v
}

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


sha512sums="
fe35c40b9038bbc4620ffcff726d650ebbf3672bb2733d414aa522bca134797306e124aae6621319ca5af67628d5565cc711ff3e5443016712c938567dd84f9d  py3-daphne-4.2.1.tar.gz
"
