# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-stestr
pkgver=4.1.0
pkgrel=1
pkgdesc="A parallel Python test runner built around subunit"
url="http://stestr.readthedocs.io/en/latest/"
arch="noarch"
license="Apache-2.0"
depends="
	py3-autopage
	py3-cliff
	py3-subunit
	py3-tomlkit
	py3-voluptuous
	py3-yaml
	"
makedepends="
	py3-gpep517
	py3-pbr
	py3-setuptools
	py3-testtools
	py3-wheel
	"
checkdepends="
	py3-ddt
	py3-future
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/s/stestr/stestr-$pkgver.tar.gz"
builddir="$srcdir/stestr-$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

	# Some tests call the "stestr" binary from the PATH so we need to make it available
	export PATH="$PATH:$PWD/.testenv/bin"
	.testenv/bin/python3 -m pytest -k 'not test_empty_with_pretty_out and not test_history_empty and not test_history_list and not test_history_remove and not test_history_empty and not test_history_list and not test_history_remove'
}

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

sha512sums="
77287ffdfe59042c4d189aa6c662df4357633d3a134ea60a4533b5b8b1b433ffd6f265a430977da175f242cc1c8e8514f876a486cc900a436cf93ab629fe7b7d  stestr-4.1.0.tar.gz
"
