# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-zope-testing
pkgver=5.1
pkgrel=0
pkgdesc="Zope testing helpers"
url="https://github.com/zopefoundation/zope.testing"
arch="noarch"
license="ZPL-2.1"
depends="python3 py3-setuptools"
makedepends="py3-gpep517 py3-wheel"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/z/zope_testing/zope_testing-$pkgver.tar.gz"
builddir="$srcdir/zope_testing-$pkgver"
options="!check" # fail for some reason

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="
e45053b2e3a8b3ecbe54bc18f1b6f4c274177aaaebd1385eac979bb245c8c25e8db28cb111d1d1a363bf9e2a153df97824074168a39b6c371ed6f68d902b40d2  zope_testing-5.1.tar.gz
"
