# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=py3-zope-hookable
_pkgname=zope.hookable
pkgver=7.0
pkgrel=0
pkgdesc="Represents the core of the Zope hookable Architecture"
url="https://github.com/zopefoundation/$_pkgname"
arch="all"
license="ZPL-2.1"
makedepends="python3-dev py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-zope-testing"
subpackages="$pkgname-pyc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/zopefoundation/$_pkgname/archive/$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces="py-zope-hookable" # Backwards compatibility
provides="py-zope-hookable=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest -v src/zope/hookable/tests/*.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
05c16b2ed0bf9708f3038d07c279efe07472f320a6d33db4cd2f518fced2f2da3ff27412222c446e224e2baf135178ccaacdea2679dce5317e7bc1fb0fbaa572  zope.hookable-7.0.tar.gz
"
