# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-jaraco.context
pkgver=6.0.1
pkgrel=0
pkgdesc="Context managers by jaraco"
url="https://github.com/jaraco/jaraco.context"
arch="noarch"
license="MIT"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="
	py3-portend
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/j/jaraco.context/jaraco_context-$pkgver.tar.gz"
builddir="$srcdir/jaraco_context-$pkgver"

# backwards compatibility for old name
replaces="py3-jaraco-context"
provides="py3-jaraco-context=$pkgver-r$pkgrel"

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/jaraco.context-$pkgver-py3-none-any.whl
}

sha512sums="
5711f581a616a18f7b7dbac65550255c7eecfae39df04b675817b16fbc5d61b833617d853c40f0b910c0ba5d144baf4c4b2add155c9b91001209b27da594a801  jaraco_context-6.0.1.tar.gz
"
