# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-pdf2image
pkgver=1.17.0
pkgrel=1
pkgdesc="A python module that wraps the pdftoppm utility to convert PDF to PIL Image object"
url="https://github.com/Belval/pdf2image"
arch="noarch"
license="MIT"
options="!check" # missing dependency that is no longer actively developed
depends="
	python3
	py3-pillow
	poppler-utils
	"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://github.com/Belval/pdf2image/archive/v$pkgver/pdf2image-$pkgver.tar.gz"
builddir="$srcdir/pdf2image-$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="
a74579901e597559782c3357ea686cc92f358a4362ac309cf23843ad15b4f5d00b7d483098e8046c0edb83ae95cbf3155e02f84a8101da4034fe4bb201191a1d  pdf2image-1.17.0.tar.gz
"
