# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-testrepository
pkgver=0.0.22
pkgrel=1
pkgdesc="A repository of test results."
arch=('any')
license=('Apache-2.0' 'BSD-3-Clause')
url="https://launchpad.net/testrepository"
depends=('python' 'python-testtools' 'python-fixtures' 'python-subunit')
makedepends=('git' 'python-hatchling' 'python-hatch-vcs' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-testresources' 'python-testscenarios')
source=("git+https://github.com/testing-cabal/testrepository.git#tag=$pkgver")
sha512sums=('b82ee42a032d91b662377523e1006c5c0e3b44c494d53e97ffa83cbd8fc7dc03744a035035c41112a1d17eaa0dd9e93b4f9bd91557a04e63654d4c7a71c841a7')

build() {
  cd testrepository
  python -m build --wheel --no-isolation
}

check() {
  cd testrepository
  python ./testr init
  python ./testr run --parallel
}

package() {
  cd testrepository
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 Apache-2.0 BSD -t "$pkgdir/usr/share/licenses/$pkgname/"
}
