# Contributor: Thomas Boerger <thomas@webhippie.de>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=py3-cli_helpers
_pkgname=cli_helpers
pkgver=2.3.1
pkgrel=1
pkgdesc="A helper library for command-line interfaces"
url="https://pypi.org/project/cli-helpers"
arch="noarch"
license="BSD-3-Clause"
depends="py3-tabulate py3-configobj"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-wcwidth"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/dbcli/cli_helpers/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$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="
ea2449f7d8b87da62a6a2bc8a10eb726a927b0cf62431016125aa30a6f7bcbee3b396364a78f749cb22c86427ca8fc7e46aaac19ea0f93ef6dee661653c2f5c0  py3-cli_helpers-2.3.1.tar.gz
"
