# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Luis Martinez <luis dot martinez at disroot dot org>

pkgname=python-icecream
pkgver=2.1.8
pkgrel=1
pkgdesc='Sweet and creamy print debugging'
arch=(any)
url='https://github.com/gruns/icecream'
license=(MIT)
depends=(
  python
  python-colorama
  python-pygments
  python-executing
  python-asttokens
)
makedepends=(
  git
  python-build
  python-installer
  python-setuptools
  python-wheel
)
source=("$pkgname::git+$url#tag=v$pkgver")
sha512sums=('caa62c49e6132d5948dd1b05f0a997d4ff9777ec693bc46824f9af1550483dcf6f5c05df91fd2929b762d4d06b5fa367c938c71881fba5f2779505f09e95e556')
b2sums=('fc26ee1bc3c6b6b6edd0f9731bbfb11fd700a6b8e38a8ade93df45f8c541c683ccefcc702f451936f33eb127fefc6c0854aa440337983f57dc6b8f90e5c5b58a')

build() {
  cd "$pkgname"

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

check() {
  cd "$pkgname"

  python -m unittest
}

package() {
  cd "$pkgname"

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

  # documentation
  install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md

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