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

pkgname=python-zope-proxy
_pkgname=zope.proxy
pkgver=7.2
pkgrel=1
pkgdesc="Generic Transparent Proxies"
arch=('x86_64' 'aarch64')
url="https://github.com/zopefoundation/zope.proxy"
license=('ZPL-2.1')
depends=(
  'glibc'
  'python'
  'python-zope-interface'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
checkdepends=(
  'python-zope-security'
  'python-zope-testrunner'
)
source=("git+$url.git#tag=$pkgver")
sha512sums=('bb26d9b08f72b7ab282f8b3e76acc62c906e52d8cace31a03fcf32afbebc279e7d7587f6415e8479222a4a2cc84f2f425489fdc8a58f2378f57408e14dea0cf5')

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

check() {
  cd $_pkgname
  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
  python -m installer --destdir="$pkgdir" dist/*.whl
}
