# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-shortuuid
_pkgname=shortuuid
pkgver=1.0.13
pkgrel=0
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="
3949493c4047f1bcc430b62d1eb1ef03febfdf627eecb285eec90b2ac78baba8264a6065c8e66ec879fe74ac5f638618ef10eb98b4e924aa7e7f63e824f2985d  shortuuid-1.0.13.tar.gz
"
