# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-wasabi
pkgver=1.1.3
pkgrel=0
pkgdesc="A lightweight console printing and formatting toolkit"
url="https://github.com/explosion/wasabi"
arch="noarch"
license="MIT"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="jupyter-nbconvert py3-ipykernel py3-pytest"
subpackages="$pkgname-doc $pkgname-pyc"
source="wasabi-$pkgver.tar.gz::https://github.com/explosion/wasabi/archive/v$pkgver.tar.gz"
builddir="$srcdir/wasabi-$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

	install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}

sha512sums="
a068e888dd715c6c2e76af06bf4c932c204953bb3a13fc16b277d3e90209f5f9a287ab8586820a55e37b7c6fd8c6224a0879c9c8bb86ece384f1997d23f23ad0  wasabi-1.1.3.tar.gz
"
