# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-niaaml
_pkgorig=NiaAML
pkgver=2.1.2
pkgrel=0
pkgdesc="Python automated machine learning framework"
url="https://github.com/firefly-cpp/NiaAML"
arch="noarch"
license="MIT"
depends="python3 py3-numpy py3-loguru py3-pandas py3-niapy py3-scikit-learn py3-typer"
checkdepends="py3-pytest-xdist"
makedepends="py3-poetry-core py3-gpep517"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://github.com/firefly-cpp/NiaAML/archive/$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$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/niaaml-$pkgver-py3-none-any.whl

	install -Dm644 docs/paper/10.21105.joss.02949.pdf -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 CITATION.cff -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 COMPONENTS.md -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 README.md -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
3c574ee98ec0865684ef87e790d9f4139dd5fd7f97854233bace108058bb590d19faaf14b80dfe62d1bd4e75eb420b2d33b869c751d724630c4e40c5ae9f98cc  NiaAML-2.1.2.tar.gz
"
