# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-pytest-helpers-namespace
pkgver=2021.12.29
pkgrel=3
pkgdesc="Pytest Helpers Namespace Plugin"
url="https://pytest-helpers-namespace.readthedocs.io/"
arch="noarch"
license="Apache-2.0"
depends="py3-pytest"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools-declarative-requirements
	py3-setuptools_scm
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="https://github.com/saltstack/pytest-helpers-namespace/archive/refs/tags/v$pkgver/py3-pytest-helpers-namespace-$pkgver.tar.gz"
builddir="$srcdir/pytest-helpers-namespace-$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
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
82c231ff11a36fce7b16a0ceea51c9306f7e05ca3f9e8cc7cc1c77ac9822f974d1ac893d2bf9b7154bf9593a529193daa041ccaaced6fdd9e38ba4f794f161b0  py3-pytest-helpers-namespace-2021.12.29.tar.gz
"
