# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=py3-rstr
pkgver=3.2.2
pkgrel=3
pkgdesc="Random string generator"
url="https://github.com/leapfrogonline/rstr"
arch="noarch"
license="BSD-3-Clause"
makedepends="py3-gpep517 py3-setuptools py3-setuptools_scm py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/r/rstr/rstr-$pkgver.tar.gz"
builddir="$srcdir/rstr-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION="$pkgver"
	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="
a7fe59cac3382a7ce4dea97b97aae607f6820a0aabf445426e0bedb127a053ed70990ac5137c52a78c2356089e0b474eac05c3cc794f705dc30a1f4ffa6c35ac  rstr-3.2.2.tar.gz
"
