# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer:
# Contributor: Eli Schwartz <eschwartz@archlinux.org>

_name=wheezy.template
pkgname=python-wheezy-template
pkgver=3.2.2
pkgrel=1
pkgdesc="lightweight template library"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url="https://github.com/akornatskyy/wheezy.template"
license=(MIT)
depends=(python)
makedepends=(
  cython
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(python-pytest)
# NOTE: no tests in pypi sdist tarball
# source=(https://files.pythonhosted.org/packages/source/${_name:0:1}/$_name/$_name-$pkgver.tar.gz)
source=(
  $pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz
)
sha256sums=('fea0cfd58f737c40dfc4d7916b08db88cb7b6a8896345f7f07739cbd8909d3f6')
b2sums=('fb25ed4e88a6e1e94311df9a94b326eb1a08ddc2497a3fc9f6567af8eb2c965b1673c5d4f4e14ec852c485fe023aa361f45d868e837611e4dca3f88f3d0b6488')

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

check() {
  cd $_name-$pkgver
  export PYTHONPATH="$PWD/src:$PYTHONPATH"
  pytest --import-mode=importlib
}

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