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

_pkgname=pylev
pkgname=python-pylev
pkgver=1.4.0
pkgrel=8
pkgdesc='A pure Python Levenshtein implementation'
arch=(any)
url="https://github.com/toastdriven/${_pkgname}"
license=(BSD)
depends=(python)
makedepends=(python-{build,installer,wheel}
             python-setuptools)
_archive="$_pkgname-$pkgver"
source=("${url}/archive/v$pkgver/$_archive.tar.gz")
sha256sums=('f7bf8fb939af1457b301a0f16b3e8c3979031e36a852b7f58fa353a33b930780')
b2sums=('d49e153d308165dcdc06bad94013afa4ccc6d2a6ecff943a2718a8f9ab71bbacb9c0cf8b604dbf0c77322a8d0cbeba5ffaed13531a31210507f144f716f8e740')

build(){
    cd "$_archive"
    python -m build -wn
}

check() {
    cd "$_archive"
    python -m unittest tests
}

package() {
    cd "$_archive"
    python -m installer -d "$pkgdir" dist/*.whl
    install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
}
