# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Patrick McCarty <pnorcks at gmail dot com>

pkgname=python-tappy
_pyname=tap_py
pkgver=3.2.1
pkgrel=1
pkgdesc="Test Anything Protocol (TAP) tools for Python"
arch=(any)
url="https://pypi.python.org/pypi/tap.py"
license=('BSD')
depends=('python' 'python-babel' 'python-pyaml' 'python-more-itertools')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel' 'python-hatchling')
checkdepends=('python-tests')
options=(!emptydirs)
source=(https://files.pythonhosted.org/packages/source/t/${_pyname}/${_pyname}-${pkgver}.tar.gz)
sha256sums=('d03c9e6af0a56fad994f1c69f14041e676811d73eeeef20bf4077c43d621d608')

build() {
	cd "$_pyname-$pkgver"
	  python -m build --wheel --no-isolation
}

check() {
	cd "$_pyname-$pkgver"
	python -m unittest discover -v
}

package() {
	cd "$_pyname-$pkgver"
	python -m installer --destdir="$pkgdir" dist/*.whl
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
