# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-webauthn
_pyname=webauthn
pkgver=2.3.0
pkgrel=0
arch="noarch"
pkgdesc="A Python3 implementation of the WebAuthn API focused on making it easy to leverage the power of WebAuthn."
url="https://pypi.python.org/project/webauthn"
license="BSD-3-Clause"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
	"
checkdepends="
	py3-pytest
	py3-cbor2
	py3-openssl
	py3-asn1crypto
"
source="$pkgname-$pkgver-gh.tar.gz::https://github.com/duo-labs/py_webauthn/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir"/py_webauthn-$pkgver
subpackages="$pkgname-pyc"

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="
c71e62dbf1b5583e0ecef430d8195757c450bd29ce4e4b3bef01d66686be3b333b31ab4e30d33defeb3e00eed41258436b68071b82e454a3a7b273fa66f111d4  py3-webauthn-2.3.0-gh.tar.gz
"
