# 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.8
pkgrel=3
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=('6e469c9c462dea705e3a6e41597972e29888e1fe1bbbb7fbc6af346a76336a047ace4ba0b0a3f12cde01d0fbd6ffee9539f55a5d95351baf351382b93e485d5f')
b2sums=('38158726a59d123cd63e414897a0445e709c0b10e4c72a463e3aa1bbe8e5c2afc3295e2f0de9d96b568c154fd0ba60b26b334a939744e2eabc4707079ec4c8cf')

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
}
