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

pkgname=python-testtools
pkgver=2.7.2
_commit=ac6919f5ead31ed331710dff921211e9c7440840
pkgrel=2
pkgdesc="Extensions to the Python standard library unit testing framework"
arch=('any')
license=('MIT')
url="https://github.com/testing-cabal/testtools"
depends=('python-setuptools')
makedepends=('git' 'python-build' 'python-installer' 'python-hatchling' 'python-hatch-vcs')
checkdepends=('python-testscenarios' 'python-testresources' 'python-fixtures' 'python-twisted')
source=("git+https://github.com/testing-cabal/testtools.git#commit=$_commit")
sha512sums=('4ac673cdb3f6499f3307c725f30cf71354235deceb646285865af8f8e0fc67a45f8db2d96d6252fb309dd7ea5ce59ac09ba8c4c8e548ea4158dcc773a2f51294')

build() {
  cd testtools
  python -m build -nw
}

check() {
  cd testtools
  python -m testtools.run testtools.tests.test_suite
}

package() {
  cd testtools
  python -m installer -d "$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
