# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-shortuuid
_pkgname=shortuuid
pkgver=1.0.11
pkgrel=4
pkgdesc="Python library that generates short, pretty, unambiguous unique IDs"
url="https://pypi.org/project/shortuuid/"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-setuptools py3-wheel py3-installer poetry py3-gpep517"
checkdepends="py3-pytest-django"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/s/shortuuid/shortuuid-$pkgver.tar.gz"
builddir="$srcdir/shortuuid-$pkgver"

replaces="py-shortuuid" # Backwards compatibility
provides="py-shortuuid=$pkgver-r$pkgrel" # Backwards compatibility

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 -m pytest -v
}

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

sha512sums="
3aec978713a9a95aa3cb269c0772fd1c4849587041d81765aac816004cad05eea29cad7cc90e31dc85b1f4886ea08c643b4495f7920f93c2a73358bdfce6edb8  shortuuid-1.0.11.tar.gz
"
