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

pkgname=python-pytest-sugar
pkgver=1.0.0
_commit=ceec846c4a8fe91f415c63c6512d88d7517010f5
pkgrel=3
pkgdesc='A plugin for py.test that changes the default look and feel of py.test'
arch=('any')
license=('BSD-3-Clause')
url='https://github.com/Teemu/pytest-sugar'
depends=('python-pytest' 'python-termcolor' 'python-packaging')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
source=("https://github.com/Teemu/pytest-sugar/archive/$_commit/$pkgname-$_commit.tar.gz")
sha512sums=('bb387de103dc0c59c926332090ff0cc84009240fcbff7216cb003f56f0b54042ee7b4448b2045654854ce0c455d3eed849452b900b7e4633146097158ca7138a')

prepare() {
  mv pytest-sugar-{$_commit,$pkgver}
}

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

check() {
  cd pytest-sugar-$pkgver
  pytest -v
}

package() {
  cd pytest-sugar-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

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