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

pkgname=python-pytest-subtests
pkgver=0.12.1
_commit=f55c65c4cbcbf2b6df3a4285c37854405a37747f
pkgrel=1
pkgdesc='unittest subTest() support and subtests fixture'
arch=('any')
license=('MIT')
url='https://github.com/pytest-dev/pytest-subtests'
depends=('python-attrs' 'python-pytest')
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools' 'python-setuptools-scm'
             'python-wheel')
source=("git+https://github.com/pytest-dev/pytest-subtests.git#commit=$_commit")
sha512sums=('e548235c630516f419b0476084f735caee29b5639d0f24b6553e5c3bf7f088b946db5e1573de5a802b60dc7c616f838edc6915c0976529cf3d9d725ad342e2de')

build() {
  cd pytest-subtests
  python -m build -nw
}

check() {
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")

  cd pytest-subtests
  python -m installer --destdir=test_dir dist/*.whl
  PYTHONPATH="$PWD/test_dir/$site_packages" pytest
}

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

# vim:set ts=2 sw=2 et:
