# Contributor: Marian Buschsieweke <marian.buschsieweke@posteo.net>
maintainer="Marian Buschsieweke <marian.buschsieweke@posteo.net>"
pkgname=py3-utils
_pkgname=python-utils
pkgver=3.9.1
pkgrel=0
pkgdesc="Convenient utilities not included with the standard Python install"
url="https://github.com/WoLpH/python-utils"
arch="noarch"
license="BSD-3-Clause"
depends="
	py3-typing-extensions
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-loguru
	py3-pytest
	py3-pytest-asyncio
	py3-pytest-cov
	"
subpackages="$pkgname-pyc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/wolph/python-utils/archive/refs/tags/v$pkgver.tar.gz
	"

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

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

sha512sums="
b6e9a48fc1be108056a07337a4015d417951aa97e2a7073a369df9c16f75bfd2fe1d56d43676b0ec24905314af35bd82e9f235bd24fe9fc122eff22e369681b4  py3-utils-3.9.1.tar.gz
"
