# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-autocommand
pkgver=2.2.2
pkgrel=4
pkgdesc="turns a python function into a CLI program"
url="https://github.com/Lucretiel/autocommand"
arch="noarch"
license="LGPL-3.0-only"
depends="python3"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/a/autocommand/autocommand-$pkgver.tar.gz
	License-is-dynamic.patch"
builddir="$srcdir/autocommand-$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="
7e78b3bb7eb62be8a308fe4406b0c72170f9a057010b02a1f8f0d2b33b5d19682d8795bb573728ebe941957ec60d86edd9db57659f63a4a2d788c7176907f067  autocommand-2.2.2.tar.gz
0def1bc91d14aa61ee00b14695dc7b3877bf7a1ee8e11aaaa1024e91a073783b718d3f1e4839085c338ee0ce814376ee3db4f32e88d10bf15768f3b0dc3d1fbb  License-is-dynamic.patch
"
