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

pkgname=python-zope-configuration
_pkgname=zope.configuration
pkgver=7.0
pkgrel=1
pkgdesc="Zope Configuration Markup Language (ZCML)"
arch=('any')
url="https://github.com/zopefoundation/zope.configuration"
license=('ZPL-2.1')
depends=(
  'python'
  'python-zope-i18nmessageid'
  'python-zope-interface'
  'python-zope-schema'
)
makedepends=(
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
checkdepends=(
  'python-zope-testing'
  'python-zope-testrunner'
)
source=("$url/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('7ec42686eef99e12bd249b3b9ab622bf724708118f847be9bd31657fa4a71642ee006315a2247f1609749da47f799fca03c08da7269c55287e57ead32eaf166a')

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

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
}
