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

pkgname=python-persistent
pkgver=6.5
pkgrel=3
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-setuptools')
checkdepends=('python-zope-testrunner' 'python-manuel')
source=("git+https://github.com/zopefoundation/persistent.git#tag=$pkgver")
sha512sums=('c4f5d0f1d6c9bf0379445ab78737347f41c930b0694aff76ca9bbf845f4c260a5554f9c6762b30dc688a2ee624bd369e4adf8174a9483c0feb6862df2f8b8190')

build() {
  cd persistent
  python setup.py build
}

check() {
  cd persistent
  python -m venv "$srcdir"/pyvenv --system-site-packages
  "$srcdir"/pyvenv/bin/python setup.py develop
  "$srcdir"/pyvenv/bin/python -m zope.testrunner --test-path=src
}

package() {
  cd persistent
  python setup.py install --root="$pkgdir" --optimize=1
}
