# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Simon Sapin <simon dot sapin at exyr dot org>
# Contributor: Kyle Keen <keenerd@gmail.com>

pkgname=python-text-unidecode
pkgver=1.3
pkgrel=12
pkgdesc="The most basic Text::Unidecode port"
url="https://github.com/kmike/text-unidecode"
license=('Artistic-1.0-Perl')
arch=('any')
depends=('python')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest')
source=("https://pypi.io/packages/source/t/text-unidecode/text-unidecode-$pkgver.tar.gz")
sha512sums=('aeaf0e79bd0545ca7a4fe700d5a7dac1d5900841fcfe8a5a568c84ba7d3bee5f75eaac0531f4a01d689a550ac5bc7e1acaeb8132293f220db8387fae2eb6a150')

build() {
  cd "$srcdir"/text-unidecode-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd "$srcdir"/text-unidecode-$pkgver
  PYTHONPATH="$PWD"/src pytest
}

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