# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-nashpy
_pkgorig=nashpy
pkgver=0.0.41
pkgrel=2
pkgdesc="A library for the computation of Nash equilibria in two player games"
url="https://github.com/drvinceknight/Nashpy"
arch="noarch !riscv64" # several errors
license="MIT"
depends="python3 py3-deprecated py3-scipy py3-networkx py3-numpy"
checkdepends="py3-pytest-xdist py3-pytest-benchmark py3-hypothesis"
makedepends="py3-gpep517 py3-flit-core"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://github.com/drvinceknight/Nashpy/archive/v$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/Nashpy-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	PYTHONPATH=src \
	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/nashpy-$pkgver-py3-none-any.whl

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

sha512sums="
958c28eace070903be33e295b0025335798aeedb0d05e22484b80b4670990a90425835db6cc6cf008eedb466f4a4c10ae33e242327b8e0f4d49bed7c33ac9941  nashpy-0.0.41.tar.gz
"
