# Contributor: Keith Maxwell <keith.maxwell@gmail.com>
# Maintainer: Keith Maxwell <keith.maxwell@gmail.com>
pkgname=py3-pytest-localserver
_pyname=pytest-localserver
pkgver=0.8.1
pkgrel=1
pkgdesc="a pytest plugin to test server connections locally"
url="https://github.com/pytest-dev/pytest-localserver"
arch="noarch"
license="MIT"
depends="python3"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="py3-pytest py3-six py3-requests py3-werkzeug"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/$_pyname/$_pyname-$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
}

sha512sums="
d0707d70b3c5caf346c7461cfca203f903277458596839cc2b1d1d48b6d1e6252e51ebcb9c21dc28fd3b98ce8368cb38e771c2a4226a5fc1dec4007f0b243cc2  pytest-localserver-0.8.1.tar.gz
"
