# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Carl Smedstad <carsme@archlinux.org>

pkgname=python-zope-testing
_pkgname=zope.testing
pkgver=5.0.1
pkgrel=5
pkgdesc="Zope testing helpers"
arch=(any)
url="https://github.com/zopefoundation/zope.testing"
license=('ZPL-2.1')
depends=(
  'python'
  'python-zope-testrunner'
)
makedepends=(
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha512sums=('169ddd82d67f54988cac6cea719095ea7b1a0e59a1b51f63ab6bf15e785877fa060bac5c0786c26244a7630ec1b97011d0bb336c9177a8e6a911ccdb673eebba')

build() {
  cd $_pkgname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_pkgname-$pkgver
  python -m installer --destdir=tmp_install dist/*.whl
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  export PYTHONPATH="$PWD/tmp_install/$site_packages"
  zope-testrunner --test-path=src -vc
}

package() {
  cd $_pkgname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}

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