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

pkgname=python-zope-configuration
_pkgname=zope.configuration
pkgver=7.1
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=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
checkdepends=(
  'python-zope-testing'
  'python-zope-testrunner'
)
source=("git+https://github.com/zopefoundation/zope.configuration.git#tag=$pkgver")
sha512sums=('cda8da15bd8343b86612a083217321c0ee418fd6c7470dc23745d92b0c6abad540dd67e1bf477ca1df50de9c15cecd56563adfe0df66d8c7c7acc2e747275d77')

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

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
}
