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

pkgname=python-subunit
pkgver=1.4.5
pkgrel=1
pkgdesc="Python implementation of subunit test streaming protocol"
arch=('any')
license=('Apache-2.0' 'BSD-3-Clause')
url="https://launchpad.net/subunit"
depends=('python-iso8601' 'python-testtools')
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-fixtures' 'python-hypothesis' 'python-testscenarios')
source=("git+https://github.com/testing-cabal/subunit.git#tag=$pkgver")
sha512sums=('a659f2596bac01e4e3eea1ba18e1fdb43cc460a6f4bb9d9c20c309a719c85678f7d5850825fbc29e4e48d0bd7aa46239aee27faf8da0dc83fe750671e6a42ff7')

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

check() {
  cd subunit
  PYTHONPATH="$PWD/build/lib" python -m testtools.run subunit.test_suite || echo "Tests failed"
}

package() {
  cd subunit
  python -m installer --destdir="$pkgdir" dist/*.whl
}
