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

pkgname=python-zope-location
_pkgname=zope.location
pkgver=6.0
pkgrel=1
pkgdesc="Special objects that have a structural location"
arch=('any')
url="https://github.com/zopefoundation/zope.location"
license=('ZPL-2.1')
depends=(
  'python'
  'python-zope-interface'
  'python-zope-proxy'
  'python-zope-schema'
)
makedepends=(
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
checkdepends=(
  'python-zope-component'
  'python-zope-configuration'
  'python-zope-copy'
  'python-zope-testrunner'
)
source=("$url/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('5b97b0a2d048f26ac7bc6987551ccb299548931132ca752f2e08337e97928d915bf000aecd8e2d36634894185a3f0e2ba70c9dea497bdd51b6c7642f99472080')

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
}
