# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=py3-pytest-env
_pyname=pytest_env
pkgver=1.1.5
pkgrel=0
pkgdesc="Pytest plugin for adding environment variables"
url="https://github.com/MobileDynasty/pytest-env"
arch="noarch"
license="MIT"
depends="python3 py3-pytest"
makedepends="py3-gpep517 py3-hatchling py3-hatch-vcs py3-installer"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$_pyname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/p/$_pyname/$_pyname-$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$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 pytest
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}
sha512sums="
8f7df6d823067f55b3e761acee76744dc64e2e0f0c1e19ef5ab4db3215e92843279742782e654e652af025126f6c31ba86a54e3ef9e2223ca6057fbdc136ddd1  pytest_env-1.1.5.tar.gz
"
