# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-tinynarm
pkgver=0.3.1
pkgrel=0
pkgdesc="Simplify numerical association rule mining"
url="https://gitlab.com/firefly-cpp/tinynarm"
arch="noarch"
license="MIT"
depends="python3 py3-niaarm"
makedepends="py3-poetry-core py3-gpep517"
checkdepends="py3-pytest-xdist"
subpackages="$pkgname-doc $pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://gitlab.com/firefly-cpp/tinynarm/-/archive/$pkgver/tinynarm-$pkgver.tar.gz"
builddir="$srcdir/tinynarm-$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 -n auto
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/tinynarm-$pkgver-py3-none-any.whl

	install -Dm644 CITATION.cff -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 README.md -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
b1bc7613f82e8cfbbd2f6a09b7099b3617bbc41b46e2f07909513dbfa2c84fdfd3490aabc80a12e086359dd3d1e0f0b5667008c9b811974464775fb810c6db6e  py3-tinynarm-0.3.1.tar.gz
"
