# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-nimfa
_pkgorig=nimfa
pkgver=1.4.0
pkgrel=4
pkgdesc="Nonnegative matrix factorization in Python"
url="https://github.com/mims-harvard/nimfa"
# segfaults in check
arch="noarch !armhf"
license="BSD-3-Clause"
depends="
	python3
	py3-numpy
	py3-scipy
	"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-matplotlib py3-pytest-xdist"
subpackages="$pkgname-pyc"
source="https://github.com/mims-harvard/nimfa/archive/v$pkgver/$_pkgorig-$pkgver.tar.gz
	importlib.patch
	"
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 -k 'not test_cbcl' # test file not present
}

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

sha512sums="
ec933a78cc64da050770e41692913df5398efb4e4cb344c2e7d7203d5051d22265ff442e166889552253d9c6e817aef40bee68e569e473ba7df8396039d964cf  nimfa-1.4.0.tar.gz
40a92e35225e0c18d27b82111db13155aa48ae03bb638c85e2dd374ad2f97ce81910544675c48b9395b7a5f2cce1e8e99bcc6bba4075049f9fb94af0b2deed0e  importlib.patch
"
