# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-pyu2f
pkgver=0.1.5a_git20211122
pkgrel=1
_gitrev="064be5ab9f4282855a15c79ecb9f7eec37f3938c"
pkgdesc="Python based U2F host library"
url="https://github.com/google/pyu2f"
arch="noarch"
license="Apache-2.0"
depends="py3-six"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
checkdepends="py3-pytest py3-mock py3-pyfakefs"
subpackages="$pkgname-pyc"
source="https://github.com/google/pyu2f/archive/$_gitrev/py3-pyu2f-$pkgver.tar.gz"
builddir="$srcdir/pyu2f-$_gitrev"

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
}

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

sha512sums="
d95683012ff2ba88dd5ad2f4020949705d0670315b0e16f1cd115da0ac92be7d506ce3562fa966226df7c45a063ae8e6bda53bac203677af42cb2ac841d0a1df  py3-pyu2f-0.1.5a_git20211122.tar.gz
"
