# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-cliff
pkgver=4.7.0
pkgrel=0
pkgdesc="Command Line Interface Formulation Framework"
url="https://docs.openstack.org/cliff/latest/"
arch="noarch"
license="Apache-2.0"
depends="
	py3-importlib-metadata
	py3-stevedore
	py3-yaml
	"
makedepends="
	py3-gpep517
	py3-pbr
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-autopage
	py3-cmd2
	py3-docutils
	py3-pytest
	py3-prettytable
	py3-stevedore
	py3-testtools
	"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/c/cliff/cliff-$pkgver.tar.gz"
options="!check" # Requires specific (old) version of py3-cmd2
builddir="$srcdir/cliff-$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="
f1e6a28fbedb911efae02a3827f019411b99afdc316fcb07b115ca2157dcd23bbcce72d2d63b9850bb5b1cb21a4787575528a26d178943f7aba2a125ed9b55e5  cliff-4.7.0.tar.gz
"
