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

pkgname=python-pytest-subtests
pkgver=0.14.2
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#tag=v$pkgver")
sha512sums=('6f1f8ac38e8f85619ac99538ca684a7344200f7394463a22245eb2b8ced750e5e9b749a64e367aeb933cf9905dd3ed86c357ad498419a9bf261cd9dd2af0b15e')

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:
