# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Carl Smedstad <carsme@archlinux.org>

pkgname=python-durationpy
_pkgname=${pkgname#python-}
pkgver=0.9
pkgrel=2
pkgdesc="Module for converting between datetime.timedelta and Go's time.Duration strings"
arch=(any)
url="https://github.com/icholy/durationpy"
license=('MIT')
depends=('python')
makedepends=(
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
source=("$url/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('0f932886b257a20c79a1fcebdcd115492b3bc07707fee8a939cf1b46e8674542')

build() {
  cd "$_pkgname-$pkgver"
  python -m build --wheel --no-isolation
}

check() {
  cd "$_pkgname-$pkgver"
  python -m unittest discover -v
}

package() {
  cd "$_pkgname-$pkgver"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
