# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=py3-mealpy
pkgver=3.0.1
pkgrel=2
pkgdesc="Meta-Heuristic Algorithms using Python"
url="https://github.com/thieu1995/mealpy"
arch="noarch"
license="GPL-3.0-or-later"
depends="python3 py3-numpy py3-matplotlib py3-opfunu py3-scipy"
checkdepends="py3-pytest-xdist"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://github.com/thieu1995/mealpy/archive/v$pkgver/mealpy-$pkgver.tar.gz
	numpy2-ptp.patch
	"
builddir="$srcdir/mealpy-$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/*.whl
}

sha512sums="
3b4ef56c7afd2d43d0bef544558439275aca14572b37ff22840705890615f10fa639a34ec1577a846df7f2a4ae7548a58898d85c175c49999a2fb7421050e0e6  mealpy-3.0.1.tar.gz
f57f23a76f6d401ca0aeb76c46c564082666aa0ac71418914d04b354c91d89998cfe53bdca37d28456a97de80977a8a0acec0176c695dea03f064e335d0b1582  numpy2-ptp.patch
"
