# Maintainer : Felix Yan <felixonmars@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Douglas Soares de Andrade <douglas@archlinux.org>

pkgname=python-zope-interface
pkgver=6.3
pkgrel=1
license=('ZPL-2.1')
arch=('x86_64' 'aarch64')
url="https://pypi.python.org/pypi/zope.interface"
pkgdesc='Zope Interfaces for Python 3.x'
depends=('python-setuptools')
makedepends=('python-build' 'python-installer' 'python-wheel')
checkdepends=('python-zope-event' 'python-zope-testing')
source=("https://pypi.io/packages/source/z/zope.interface/zope.interface-$pkgver.tar.gz")
sha512sums=('fcc318fd098ca91a4617f2a15123cb727c4ebcdeb56b4e0c59475a55d67afdfeb2f2e2d0fdef462e22236c8733ba2c5982ba72c8e75648be6bf55116f5d39139')

prepare() {
  cd zope.interface-$pkgver
  sed -i '/coverage/d' setup.py
}

build() {
  cd zope.interface-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd zope.interface-$pkgver
  local python_version=$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))')
  PYTHONPATH="$PWD/build/lib.linux-$CARCH-cpython-$python_version" python setup.py test
}

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