# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-wand
_pyname=wand
pkgver=0.6.13
pkgrel=2
pkgdesc="Ctypes-based simple MagickWand API binding for Python"
url="https://github.com/emcconville/wand"
license="MIT"
arch="noarch"
depends="
	imagemagick
	libxml2
"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
"
checkdepends="
	py3-pytest
	py3-pytest-xdist
	py3-pytest-cov
	py3-psutil
	imagemagick-jpeg
"
source="$pkgname-$pkgver.tar.gz::https://github.com/emcconville/wand/archive/$pkgver.tar.gz"
builddir="$srcdir"/$_pyname-$pkgver
subpackages="$pkgname-pyc"

prepare() {
	default_prepare
	rm pyproject.toml
}

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
	# test_*_quantum: failure on 32-bit arches
	.testenv/bin/python3 -m pytest -v -k 'not quantum'
}

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

sha512sums="
4551ba719b6bb90bb6818e9f0fcb9e35e41c5e49de17b565f4b8b148b03a25eff4033ed9d49ebc46f2e9fbfc83ae976f817fe595a11a4704b12c77954506ffc0  py3-wand-0.6.13.tar.gz
"
