# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-pyswarms
_pkgorig=pyswarms
pkgver=1.3.0
pkgrel=6
pkgdesc="A research toolkit for particle swarm optimization in Python"
url="https://github.com/ljvmiranda921/pyswarms"
arch="noarch"
license="MIT"
depends="
		python3
		py3-attrs
		py3-cycler
		py3-future
		py3-kiwisolver
		py3-matplotlib
		py3-numpy
		py3-parsing
		py3-dateutil
		py3-scipy
		py3-tqdm
		py3-yaml
		"
checkdepends="py3-pytest-xdist"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/p/pyswarms/pyswarms-$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$pkgver"
# fail with new deps
options="!check"

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() {
	rm -rf tests/
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
0aba56044417f40fe294b2fa427a1cc548c1e9825de436ee62ed6b2fdc32707976c10c8eefd6212cb73b41e8e54dbb06737ab769e6e53a54ef288d2048b19f9b  py3-pyswarms-1.3.0.tar.gz
"
