# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-retry
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=retry
pkgver=0.9.2
pkgrel=0
pkgdesc="Easy to use retry decorator"
url="https://github.com/invl/retry"
arch="noarch"
license="Apache-2.0"
depends="
	py3-decorator
	py3-py
"
checkdepends="
	py3-pytest
"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/invl/retry/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

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 "$builddir"/.dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

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

sha512sums="
69b4a24cb185a0ddf86b098de8fbb31b311c0b76bad39516c62dfbc30f9706868b8482d4e8697fa782a16e83b713151d03eef10aae49bb0e5ba669ad5add13a1  py3-retry-0.9.2.tar.gz
"
