# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-scikit-uplift
_pkgorig=scikit-uplift
pkgver=0.5.1
pkgrel=4
pkgdesc="Classic approaches of Uplift modelling in scikit-learn style in python"
url="https://www.uplift-modeling.com"
arch="noarch !s390x !x86 !armhf !armv7" # py3-scikit-learn, py3-matplotlib, memory errors
license="MIT"
depends="python3 py3-scikit-learn py3-numpy py3-pandas py3-matplotlib py3-requests py3-tqdm"
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/s/scikit-uplift/scikit-uplift-$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$pkgver"
options="!check" # fail with new deps

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="
964146b29784b52f6fe05e64398b4a1fe91ec639b7341b9be79fd6d5d545e9dc3ce257c0df63c6b3455d657928df72e0c82a3912df0a805944238979208a7c5e  py3-scikit-uplift-0.5.1.tar.gz
"
