# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-stochastic
_pkgorig=stochastic
pkgver=0.7.0
pkgrel=6
pkgdesc="Generate realizations of stochastic processes in python"
url="https://github.com/crflynn/stochastic"
arch="noarch"
license="MIT"
depends="python3 py3-numpy py3-scipy"
makedepends="py3-gpep517 py3-setuptools py3-poetry-core py3-installer"
checkdepends="py3-pytest py3-pytest-xdist py3-pytest-cov"
subpackages="$pkgname-pyc"
source="https://github.com/crflynn/stochastic/archive/$pkgver/$_pkgorig-$pkgver.tar.gz
	numpy2-array-markov-chain.patch
	poetry-core.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
}

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

sha512sums="
cc6b70c51cd5b3bde2deaa632e2f8dfae5b48b71bd326a420588c15de7e687e006746aa2427d26ff74b75d69413be3a2ce4e0edcf327971699f7ece425de89b4  stochastic-0.7.0.tar.gz
e9f648a6e3a10e6fa72a293fd084bbbb3c5a2c8704d339b885b507de8d40b48b87ea013c2327244169b83e32d06ad55d6fcd0bd0fdb7ca1332fd11cc12e18cd8  numpy2-array-markov-chain.patch
fbd37c4960f8936af3a77ac6c89a0726f433b6aa683cbd06926d94db47d3eb8b9836a88c9f111069be70dd9b6f1d2fa043c3d73986a3019f7a2521721a97427d  poetry-core.patch
"
