# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-augmentor
pkgver=0.2.12
pkgrel=2
pkgdesc="Image augmentation library in Python for machine learning"
url="https://github.com/mdbloice/Augmentor"
arch="noarch"
license="MIT"
depends="
	py3-numpy
	py3-pillow
	py3-tqdm
	python3
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest-xdist"
subpackages="$pkgname-pyc"
source="https://github.com/mdbloice/Augmentor/archive/$pkgver/Augmentor-$pkgver.tar.gz"
builddir="$srcdir/Augmentor-$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 -k 'not test_ground_truth_by_class'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
27a37d52cbf51dcb2bb8c7c5d74efbe2d2cb066b9ed958b3a84456d524fff82dd19e9da1ab23064490171d078ebd764e900fc39d8fb4e4bd1e23b13e0589cb85  Augmentor-0.2.12.tar.gz
"
