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

pkgname=python-persistent
pkgver=6.5
pkgrel=4
pkgdesc="Translucent persistent objects"
arch=('x86_64' 'aarch64')
license=('ZPL-2.1')
url="https://github.com/zopefoundation/persistent/"
depends=('python-cffi' 'python-zope-interface' 'python-zope-deferredimport')
makedepends=('git' 'python-build' 'python-installer' 'python-wheel' 'python-setuptools')
checkdepends=('python-zope-testrunner' 'python-manuel')
source=("git+https://github.com/zopefoundation/persistent.git#tag=$pkgver")
sha512sums=('c4f5d0f1d6c9bf0379445ab78737347f41c930b0694aff76ca9bbf845f4c260a5554f9c6762b30dc688a2ee624bd369e4adf8174a9483c0feb6862df2f8b8190')

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

check() {
  cd persistent
  local builddir=(build/lib.*)
  PYTHONPATH="$PWD/${builddir[0]}" python -m zope.testrunner --test-path=src
}

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