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

pkgname=python-zope-hookable
_pkgname=zope.hookable
pkgver=8.2
pkgrel=1
pkgdesc="Represents the core of the Zope hookable Architecture"
arch=('x86_64' 'aarch64')
url="https://github.com/zopefoundation/zope.hookable"
license=('ZPL-2.1')
depends=(
  'glibc'
  'python'
)
makedepends=(
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
checkdepends=('python-zope-testrunner')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha512sums=('b746af297f1d081d8a6ea5cc94db834d94b0e6c579a338abbee6ecc92fda44d81d85d5bcde6a8bdb85571b551b30419c95eaf0e2c59e4e8493e086ec26c450de')

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

check() {
  cd $_pkgname-$pkgver
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m zope.testrunner -vc --test-path src/
}

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