# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-typer
pkgver=0.14.0
pkgrel=0
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-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
}

sha512sums="
1a693031068677f38ad0e0688321c3e990608a20342b8e169ea72ff18b0a99c08f186a2024e591f7f4b979eb4817e88e201e6aadaa752484c8260de7f8c41827  typer-0.14.0.tar.gz
"
