# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Henrik Riomar <henrik.riomar@gmail.com>
pkgname=py3-pyseto
_pkgname=pyseto
pkgver=1.17.4
pkgrel=2
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

	rm -r "$pkgdir"/usr/lib/python3*/site-packages/CHANGES.rst
	rm -r "$pkgdir"/usr/lib/python3*/site-packages/poetry.lock
	rm -r "$pkgdir"/usr/lib/python3*/site-packages/tox.ini

}
sha512sums="
fa4f75d1901864c4e2cdb622022387e0bdb4119ac117732ae44315d11b6b195bd2d4b70114f0d50e612d50c9a823c9231f14a36462d63240ad13f15efd6d5724  py3-pyseto-1.17.4.tar.gz
"
