# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-webauthn
_pyname=webauthn
pkgver=2.5.3
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.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="
25b32a767c293ecd9511585c97d1f27a17769816e5b884a16258fa3fa17adb5ca6580838209dfe4e0db032614588b2ccff3d071032a4b984d3fcae24459c82e6  py3-webauthn-2.5.3.tar.gz
"
