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

pkgname=python-invoke
pkgver=2.2.0
pkgrel=1
pkgdesc="Pythonic task execution"
url="https://github.com/pyinvoke/invoke"
license=('BSD')
arch=('any')
depends=('python-fluidity' 'python-lexicon' 'python-yaml')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-pytest' 'python-pytest-relaxed' 'python-icecream')
source=("https://pypi.io/packages/source/i/invoke/invoke-$pkgver.tar.gz")
sha512sums=('4b208a00ecc5eb2feccd01bb3f11248327ede703ddbc0456182165cdb30bdeab603ef7021c46c383cd4caf40c539e0f5c8746bd34e0eb77fc111464ea52f01b1')

prepare() {
  rm -r invoke-$pkgver/invoke/vendor
}

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

check() {
  cd invoke-$pkgver
  PYTHONPATH="$PWD"/build/lib pytest -s tests -k 'not pty'
}

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