# Maintainer: Carl Smedstad <carsme@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-mako
_pkgname=${pkgname#python-}
pkgver=1.3.10
_pkgver=rel_${pkgver//./_}
pkgrel=1
pkgdesc="A template library written in Python"
arch=(any)
url="https://github.com/sqlalchemy/mako"
license=(MIT)
depends=(
  python
  python-markupsafe
)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(
  # python-lingua isn't packaged
  python-babel
  python-beaker
  python-dogpile.cache
  python-pygments
  python-pytest
)
optdepends=(
  'python-babel: for i18n features'
  'python-beaker: for caching support'
  'python-dogpile.cache: for caching support'
  'python-pygments: for syntax highlighting'
  'python-pytest: for testing utilities'
)
source=("$pkgname-$pkgver.tar.gz::$url/archive/$_pkgver.tar.gz")
sha512sums=('3052ea29570b28e249cd73fa29c27606f285895e22393c4974db0f391908c0bba747ecfe92aca660e8b7f3806ac4abbad9576bad94f149f18462eaaa90f1044e')

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

check() {
  cd "$_pkgname-$_pkgver"
  pytest
}

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