# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>

pkgname=python-genshi
pkgver=0.7.9
pkgrel=1
pkgdesc='Toolkit for stream-based generation of output for the web'
arch=('x86_64' 'aarch64')
url='https://genshi.edgewall.org'
license=('BSD-3-Clause')
depends=('python' 'python-six')
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
checkdepends=('python-pytest')
source=("$pkgname::git+https://github.com/edgewall/genshi#tag=$pkgver")
sha512sums=('01e93add8eb378518c5f66881e0a5711b15889a19aeb10986137b5fbc0a2e1966c2f78bd3918369e1d526cd1ab617e1808c2db4193a69c2567ef8df7316ab462')
b2sums=('885b46a82548a93e39a2012f4bcc3a5c0cd9339e92e6e6a70759758cfae615c4e5a109ddec035318db8ce1b3fae8970bf0d075d7dfcc0a9ae2d0ad519f9c3605')

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

check() {
  cd "$pkgname"

  pytest -v
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" COPYING
}
