# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer:
pkgname=py3-testfixtures
pkgver=7.2.2
pkgrel=1
pkgdesc="Collection of helpers and mock objects for unit tests and doc tests"
url="https://github.com/Simplistix/testfixtures"
arch="noarch"
license="MIT"
depends="python3"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-sphinx
	py3-wheel
	"
checkdepends="
	py3-django
	py3-pytest
	py3-sybil
	py3-twisted
	py3-zope-component
	"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/t/testfixtures/testfixtures-$pkgver.tar.gz"
builddir="$srcdir/testfixtures-$pkgver"
options="!check" # inconsistent leeading whitespace

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
	cd .testenv
	bin/python3 -m pytest
}

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

	rm -r "$pkgdir"/usr/lib/python3*/site-packages/testfixtures/tests/
}

sha512sums="
4f7a5ed659b650080deac0b1caff6d2dff0b71d23eaeb26b48b7daa4df85dc0a1f6cfef98275c9a90289eb893c0a06311c849b84f2cc35447fb766f4d0d41c89  testfixtures-7.2.2.tar.gz
"
