# Contributor: Jonas <3426-spameier@users.gitlab.alpinelinux.org>
# Maintainer: Jonas <3426-spameier@users.gitlab.alpinelinux.org>
pkgname=py3-pytest-repeat
_pyname=pytest-repeat
pkgver=0.9.3
pkgrel=1
pkgdesc="pytest plugin for repeating tests"
url="https://github.com/pytest-dev/pytest-repeat"
arch="noarch"
license="BSD-3-Clause"
depends="
	py3-pytest
	python3
	"
makedepends="
	py3-gpep517
	py3-hatch-vcs
	"
checkdepends="py3-tox"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/pytest-dev/pytest-repeat/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	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
	rm -rf "$pkgdir"/usr/lib/python3.*/site-packages/tests/ # remove tests
}

sha512sums="
01182e5acfce08a2eda0faf069e3611865eeb3d05db54e65f937666d42eb6072bb7e9ab2abceb00792c9905f75e6ba99c08a1fe05588e14d7e3cd816ca4688e9  py3-pytest-repeat-0.9.3.tar.gz
"
