# Maintainer:
pkgname=py3-nose2
pkgver=0.15.1
pkgrel=0
pkgdesc="Successor to nose, based on unittest"
url="https://docs.nose2.io/en/latest/"
arch="noarch"
license="LGPL-2.0-or-later"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="https://github.com/nose-devs/nose2/archive/refs/tags/$pkgver/nose2-$pkgver.tar.gz"
builddir="$srcdir/nose2-$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 unittest
}

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

	rm -r "$pkgdir"/usr/lib/python*/site-packages/nose2/tests
}

sha512sums="
88a22cafb4516c4c86d81bd68710d49e018614d1512a030fe07bffe57cf364c780050d98a64ea1c69b5bdb1ef8ad69dab5ad1199192ddd2bf6568dca040aee77  nose2-0.15.1.tar.gz
"
