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

pkgname=python-subunit
pkgver=1.4.6
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' 'python-yaml')
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=('f7434d2907b3382f437b59fb172d6c8e7b064d852d1a91ac92a3dc28791db054d4b263823dcce91c2388020725df09b95a8164d99ea3f4a34a1a545052f6446c')

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
}
