# Contributor: Philipp Glaum <p@pglaum.de>
# Maintainer: Philipp Glaum <p@pglaum.de>
pkgname=py3-pytest-rerunfailures
_pkgname=${pkgname#py3-}
pkgver=13.0
pkgrel=1
pkgdesc="Pytest plugin to re-run tests to eliminate flaky failures"
url="https://pypi.org/project/pytest-rerunfailures/"
arch="noarch"
license="MPL-2.0"
depends="python3 py3-pytest"
makedepends="py3-setuptools py3-gpep517 py3-installer py3-wheel"
checkdepends="py3-mock"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
options="!check"

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="
466da7beac4785c82362e65c2c3420a5ac7c3d52a2b0c00f67ab6b8a5c64a51fc0b2172e7308c072b28a0cb0f74e1178f94ade3b10f4ad929ddf33057c80a654  pytest-rerunfailures-13.0.tar.gz
"
