# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-plac
pkgver=1.4.3
pkgrel=1
pkgdesc="Parsing the command line the easy way"
url="https://github.com/ialbert/plac"
arch="noarch"
license="BSD-2-Clause"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/plac/plac-$pkgver.tar.gz
	index.rst" # replicate index.rst for tests to pass
builddir="$srcdir/plac-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	cp "$srcdir/index.rst" "$builddir/doc/index.rst"

	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -W error doc/test_plac.py
}

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

sha512sums="
2222657bc524307e342ff21cfbbf0278ac618f2b9db8788362325ad955e5ca5181cf9770564bdef9bbb6acbb52750771593311c0d32aa85f343f51a7b28d0caa  plac-1.4.3.tar.gz
763e0838200a4dc25c4d4a74a9dc5b8ff8c32f5e67d00207a9f43274ad42eff1e0c6f08d04dc7123967d9426231d1ba3b0f0e8c0fcc688a528389e22f5b4c477  index.rst
"
