# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Henrik Riomar <henrik.riomar@gmail.com>
pkgname=py3-pyseto
_pkgname=pyseto
pkgver=1.8.2
pkgrel=0
pkgdesc="A Python implementation of PASETO and PASERK."
url="https://github.com/dajiaji/pyseto"
arch="noarch"
license="MIT"
depends="
	py3-argon2-cffi
	py3-cryptography
	py3-iso8601
	py3-passlib
	py3-pycryptodomex
	"
makedepends="
	py3-gpep517
	py3-poetry-core
	py3-setuptools
	"
checkdepends="
	py3-freezegun
	py3-pytest
	py3-pytest-cov
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/dajiaji/pyseto/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$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
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest
}

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

sha512sums="
46cf51715e690bec9020d73aabccc3117a1bba2694ca536c82a5a5a20779ae2d1a27caf646e36bff28e2426a1b8da65231e3016e47b2a5dbdbe96efd2995bda9  py3-pyseto-1.8.2.tar.gz
"
