# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=py3-pkginfo
pkgver=1.10.0
pkgrel=1
pkgdesc="Parses metadata stored by distutils in PKG-INFO"
url="https://code.launchpad.net/~tseaver/pkginfo"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/pkginfo/pkginfo-$pkgver.tar.gz
	disable-failing-test.patch
	dont-package-tests.patch
	"
builddir="$srcdir/pkginfo-$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
}

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

sha512sums="
d1350166bc6d37d8c7f227bfee332f5d289e1a513a13db1ba75992dbb24b30b42b2b95d2fe55ca249c83132e880a46975d4146e0cb9d5b1d103da2e9ce36a858  pkginfo-1.10.0.tar.gz
3eb9d1fe871b312f75b96158fa59f25a4533ac23873042776c129fa9489bc1e16883e4e2bef6401b283b8479b0cf86c4b49a5400c261ebea106bc01233881198  disable-failing-test.patch
7a5752ff90959db45c4285d4a79a8a643ea2d90e81d137792dd3b487191d74adab85969cae0041981e7ae164926c0226a413f615473fc2b82f84aa8b714caf80  dont-package-tests.patch
"
