# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-click
pkgver=8.1.8
pkgrel=1
pkgdesc="Simple wrapper around optparse for powerful command line utilities"
url="https://click.palletsprojects.com"
arch="noarch"
license="BSD-3-Clause"
makedepends="
	py3-flit-core
	py3-gpep517
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/c/click/click-$pkgver.tar.gz"
builddir="$srcdir/click-$pkgver"

replaces="py-click" # Backwards compatibility
provides="py-click=$pkgver-r$pkgrel" # Backwards compatibility

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="
943e31a31369eb09d5da8efd89cca340229ab6ecbb49c02dcdabcce090099705b9b6a1bc12380ec9b8baacd469c3573ea8311b2197c594e591e5738a735e92b6  click-8.1.8.tar.gz
"
