# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Maxim Andersson <thesilentboatman@gmail.com>
# Contributor: NicoHood <archlinux {cat} nicohood {dog} de>

pkgdesc="A module with some convenient utilities not included with the standard Python install"
pkgname=python-utils
pkgver=3.8.2
pkgrel=1
arch=(any)
url="https://github.com/WoLpH/python-utils"
license=(BSD-3-Clause)
depends=(
  python
  python-typing-extensions
)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(
  python-loguru
  python-pytest
)
optdepends=('python-loguru: for logging support')
source=(
  $url/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz{,.asc}
)
sha512sums=('e0de794abe95f3e205fcbde0fd52615f44128ffb702a406ff0d3f7ce2640ff60ac3cc508829245bce750ed191c9d3ae563b8f0619af4c2c43cacde6a1aa0fde4'
            'SKIP')
b2sums=('3c53c02729f601b30e68a26cd4b61e49c29f036a1327c43124e326dae173d1b528035bb0952c349ec43f3cd6e159c2e0d5e82c8c46efd12c95f445dbb20751c0'
        'SKIP')
validpgpkeys=('149325FD15904E9C4EB89E95E81444E9CE1F695D') # Rick van Hattem <wolph@wol.ph>

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

check() {
  cd $pkgname-$pkgver
  pytest -vv -c /dev/null
}

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