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

pkgname=python-testresources
pkgver=2.1.2
pkgrel=1
pkgdesc="Testresources, a pyunit extension for managing expensive test resources"
arch=('any')
license=('Apache-2.0' 'BSD-3-Clause')
url="https://launchpad.net/testresources"
depends=('python')
makedepends=('git' 'python-build' 'python-hatch-vcs' 'python-hatchling' 'python-installer' 'python-wheel')
checkdepends=('python-fixtures' 'python-testtools')
source=("git+https://github.com/testing-cabal/testresources.git#tag=$pkgver")
sha512sums=('13bb908d0984f6d522d8370ecb2a30e190fbca0b3d371c313c75607dcc22709e93c611e73eb93138ac8c36b99b080b2981d509d326ec2b9cb235aec76e851976')

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

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

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