# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-dunamai
pkgver=1.24.0
pkgrel=0
pkgdesc="Dynamic versioning library and CLI"
url="https://github.com/mtkennerly/dunamai"
arch="noarch"
license="MIT"
depends="py3-packaging"
makedepends="py3-gpep517 py3-poetry-core py3-wheel py3-installer"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/mtkennerly/dunamai/releases/download/v$pkgver/dunamai-$pkgver.tar.gz"
builddir="$srcdir/dunamai-$pkgver"
options="!check" # tests require a git repo

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="
1a9c0152a661431f8fe4a4444931cdfe07277b2fce003a0960eac3e01ea45a82db2816d1534e6f6f2107df35bdd2ec4cbbc4e12f3404bcedb6c443a287d5c443  dunamai-1.24.0.tar.gz
"
