# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-emcee
pkgver=3.1.6
pkgrel=0
pkgdesc="Python ensemble sampling toolkit for affine-invariant MCMC"
url="https://github.com/dfm/emcee"
arch="noarch !x86 !armhf !armv7"
license="MIT"
depends="
	py3-numpy
	"
makedepends="
	py3-gpep517
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="
	py3-h5py
	py3-pytest-cov
	py3-pytest-xdist
	py3-scipy
	"
subpackages="$pkgname-pyc"
source="https://github.com/dfm/emcee/archive/v$pkgver/emcee-$pkgver.tar.gz"
builddir="$srcdir/emcee-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	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/*.whl

	rm -r "$pkgdir"/usr/lib/python*/site-packages/emcee/tests
}

sha512sums="
0715cb71f4b1381751effa2f0a49463c246b3ee77e2e9caeeb5a97fd6119a5c78c5ad91e44ff048bfde9491299cfb466467b59b9062beef0064345511bbbf7df  emcee-3.1.6.tar.gz
"
