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

pkgname=python-pyte
pkgver=0.8.2
pkgrel=4
pkgdesc='Simple VTXXX-compatible terminal emulator'
arch=('any')
license=('LGPL3')
url='https://github.com/selectel/pyte'
depends=('python-wcwidth')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest')
source=("https://github.com/selectel/pyte/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('e9e79babb81b32eedbb4f0585ef07f8978e8592171834d9ce43a09f8a1d3156c00abb535e887ba9c83909bf1010210009b9a00ccbec7c2e430e5147120949743')

prepare() {
  sed -i 's/"pytest-runner"//' pyte-$pkgver/setup.py
}

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

check() {
  cd pyte-$pkgver
  PYTHONPATH="$PWD" pytest
}

package() {
  cd pyte-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}

# vim:set ts=2 sw=2 et:
