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

_pkgname=pastel
pkgname=python-pastel
pkgver=0.2.1
pkgrel=7
pkgdesc='Bring colors to your terminal'
arch=(any)
url="https://github.com/sdispater/${_pkgname}"
license=(MIT)
depends=(python)
makedepends=(python-{build,installer,wheel}
             python-poetry-core)
checkdepends=(python-pytest)
_archive="$_pkgname-$pkgver"
source=("https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_archive.tar.gz")
sha256sums=('e6581ac04e973cac858828c6202c1e1e81fee1dc7de7683f3e1ffe0bfd8a573d')

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

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

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