# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Filipe Laíns (FFY00) <lains@archlinux.org>

pkgname=python-dill
pkgver=0.3.9
pkgrel=1
pkgdesc='serialize all of Python'
arch=(any)
url='https://github.com/uqfoundation/dill'
license=('MIT')
depends=('python')
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
optdepends=('python-objgraph: graph support')
source=("$pkgname::git+$url#tag=$pkgver")
sha512sums=('dac14d56f4492e148080a519306c483d245c73ae0179805d2c772ad5d48e62a9db43a6419df63de0857f5c48c35f0bda54830590b8404c5cb1ab56cde54678e2')
b2sums=('db2cce3445c3a5d41c76709683d5ac73a96998e8e03c528537f670d98a9fbb388411c6977c668abd6a5336a95acf924593b1ada99eb230c0c7dd5a838c4b8bf7')

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

check() {
  cd "$pkgname"

  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python dill/tests/__main__.py
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
