# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-jaraco.test
pkgver=5.5.1
pkgrel=0
pkgdesc="jaraco test module"
url="https://github.com/jaraco/jaraco.test"
arch="noarch"
license="MIT"
depends="
	py3-jaraco.collections
	py3-jaraco.context
	py3-jaraco.functools
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="python3-tests py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/jaraco/jaraco.test/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/jaraco.test-$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
	# ModuleNotFoundError: No module named 'test.support'
	.testenv/bin/python3 -m pytest \
		--ignore jaraco/test/cpython.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/jaraco*.whl
}

sha512sums="
03a88b0d56b9956155faf6ddeaefee5326109618c4a0f7dba783c09bcbf2532ece1afce2e505f5a35a95779701481b3ddd8b40c5d68d1ebf81b9b6fcdc0fff4a  py3-jaraco.test-5.5.1.tar.gz
"
