# Contributor: Justin Berthault <justin.berthault@zaclys.net>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=py3-crashtest
_pyname=crashtest
pkgver=0.4.1
pkgrel=5
pkgdesc="Manage Python errors with ease"
url="https://github.com/python-poetry/crashtest"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-poetry-core"
checkdepends="py3-pytest py3-pytest-cov"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/python-poetry/crashtest/archive/$pkgver/crashtest-$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="
83faf66fb422c8fb13780ac5a8ddd4c47ebb77f248bea0eb94962caff24265b107fd8bbc0d577853969c4aecedd83977e9c74c81dc7e772b7684e09a832a0a2f  py3-crashtest-0.4.1.tar.gz
"
