# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: David Runge <dvzrv@archlinux.org>
# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
# Contributor: Alexander Rødseth <rodseth@gmail.com>

pkgname=python-sh
pkgver=2.0.7
pkgrel=1
pkgdesc='Subprocess interface that allows you to call any program as if it were a function'
arch=(any)
url='https://github.com/amoffat/sh'
license=('MIT')
depends=('python')
makedepends=('git' 'python-setuptools' 'python-build' 'python-installer' 'python-wheel'
             'python-poetry-core')
checkdepends=('lsof' 'python-pytest')
source=("git+https://github.com/amoffat/sh.git#tag=$pkgver")
sha512sums=('7c2e7d93afddda12ecbd73028d1709941eea7a39ab8dc1edec7c7113c3233ac70c3f981cf6af2f3d18ecf1bbcaca89f3a969ef2c3f0f486959bfa91a9c734213')
b2sums=('d042f84637693eba02b4be1bdb3b65312f6ba68aa5bcdef3c6f9288e93d44d5076d40f22b982d0b7eeeb8b99d8a6877c4e351d4dde5681b8166ae58a93b002aa')

build() {
  cd sh
  python -m build --wheel --no-isolation
}

check() {
  cd sh
  # export PYTHONPATH="$(pwd):${PYTHONPATH}"
  pytest tests -k 'not test_environment'
}

package() {
  cd sh
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm644 LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
  install -vDm644 {README.rst,CHANGELOG.md} \
    -t "$pkgdir"/usr/share/doc/$pkgname/
}

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