# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
maintainer="Iztok Fister, Jr. <iztok@iztok.dev>"
pkgname=py3-typer
pkgver=0.15.1
pkgrel=1
pkgdesc="Building CLI applications"
url="https://github.com/fastapi/typer"
arch="noarch"
license="MIT"
depends="python3 py3-click py3-typing-extensions"
checkdepends="py3-pytest-xdist py3-pytest-cov py3-pytest-sugar py3-rich  py3-shellingham"
makedepends="py3-gpep517 py3-pdm-backend"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://github.com/fastapi/typer/archive/$pkgver/typer-$pkgver.tar.gz"
builddir="$srcdir/typer-$pkgver"

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

check() {
	PYTHONPATH=src \
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto -k 'not test_completion and not test_tutorial'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/typer-$pkgver-py3-none-any.whl

	install -Dm644 CITATION.cff -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 README.md -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
0f92f78ff809b43f2371ca258a2ada59b67bb1d173f72acd0aa303f720e7bda62a66ded18c84994a298220cc2a98bb3d26166caec503ee5289c88b988e1f391a  typer-0.15.1.tar.gz
"
