# 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.9.1
pkgrel=1
arch=(any)
url="https://github.com/WoLpH/python-utils"
license=(BSD-3-Clause)
depends=(
  python
  python-typing_extensions
)
makedepends=(
  git
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(
  python-loguru
  python-pytest
)
optdepends=('python-loguru: for logging support')
source=(
  git+$url.git?signed#tag=v$pkgver
)
sha512sums=('15afa010a8bb5009345d4e707014a2c679d60b313cc25e7b09c54e1562248402b3e917a83c4c5b262e2a787a2322d0ef74cab4cfd2ce4ebb90cc4f5f7f481615')
b2sums=('0437e1915aff3e0842f2636d50018534c69f3858128dd4123eb2b7825bbf408ffdd6d46dbefd0aff5930008d8fbf91c18eb02c422b8d81b1385f750a39bbca28')
validpgpkeys=('149325FD15904E9C4EB89E95E81444E9CE1F695D') # Rick van Hattem <wolph@wol.ph>

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

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

package() {
  cd $pkgname
  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/"
}
