# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-argon2-cffi
pkgver=23.1.0
pkgrel=0
pkgdesc="The secure Argon2 password hashing algorithm"
url="https://argon2-cffi.readthedocs.io/en/stable/"
arch="all"
license="MIT"
depends="
	python3
	py3-argon2-cffi-bindings
	py3-cffi
	"
makedepends="
	argon2-dev
	libffi-dev
	py3-gpep517
	py3-hatch-fancy-pypi-readme
	py3-hatch-vcs
	py3-hatchling
	python3-dev
	"
checkdepends="py3-pytest py3-hypothesis"
subpackages="$pkgname-pyc"
source="https://pypi.io/packages/source/a/argon2-cffi/argon2_cffi-$pkgver.tar.gz"
builddir="$srcdir/argon2_cffi-$pkgver"

build() {
	export ARGON2_CFFI_USE_SYSTEM=1
	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
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
7c7730451f5ef9bb40bb5e1bbfa6e69c9718968168f3fa9b54e1020a4f805f98fba6260039bda804241717db2338479d640c7652dc26ce1a6ade076660133383  argon2_cffi-23.1.0.tar.gz
"
