# Contributor: prspkt <prspkt@protonmail.com>
# Maintainer: prspkt <prspkt@protonmail.com>
pkgname=py3-piexif
_pyname=piexif
pkgver=1.1.3
pkgrel=8
pkgdesc="EXIF manipulations with Python"
url="https://github.com/hMatoba/Piexif"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
checkdepends="py3-pillow"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pyname:0:1}/$_pyname/$_pyname-$pkgver.zip
	fix-running-tests.patch
	"
builddir="$srcdir"/$_pyname-$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 --no-compile .dist/*.whl
	.testenv/bin/python3 -m unittest -v tests/s_test.py
}

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

sha512sums="
df5f7793c39911af58bbae76cf998e2a7bc820b84dcf9808ee8f6a38f766f824fef28392ef88387e18b10c270c4b27881be310f0368076b6fb65379a11a93270  piexif-1.1.3.zip
5b4ca4ffc6b15246870d5f0cde41a7393702a827d81e88efcf561eb45ae58c75dd0d2917285b6e2fc1dbeedce2ed19d0bf042f20d6412e6f9022a0d0ce27fe4e  fix-running-tests.patch
"
