# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=xkcdpass
pkgver=1.20.0
pkgrel=0
pkgdesc="Generate secure multiword passwords/passphrases"
url="https://github.com/redacted/XKCD-password-generator"
arch="noarch"
license="BSD-3-Clause"
depends="py3-xkcdpass"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="py3-$pkgname-pyc py3-$pkgname:py3"
source="https://files.pythonhosted.org/packages/source/x/xkcdpass/xkcdpass-$pkgver.tar.gz"

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 tests/test_xkcdpass.py
}

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

py3() {
	pkgdesc="Python library for $pkgname"

	amove usr/lib/python*
}

sha512sums="
4e21e9c2924ae65e21d79c6389ff574715acaa7a13c5d065b38e97ed1d2b6581a51a5e7b7acbbaa09e4ba241c4df15d05d95b9bcc990d3bb6f3b0b4b581d7b85  xkcdpass-1.20.0.tar.gz
"
