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

_pkgname=shellingham
pkgname=python-shellingham
pkgver=1.5.4
pkgrel=2
pkgdesc='Detect what shell the current Python executable is running in'
arch=(any)
url="https://github.com/sarugaku/${_pkgname}"
license=(ISC)
depends=(python)
makedepends=(python-{build,installer,wheel}
             python-setuptools)
checkdepends=(python-pytest{,-mock})
_archive="$_pkgname-$pkgver"
source=("$url/archive/$pkgver/$_archive.tar.gz")
sha256sums=('9efba7106b6192be290b6ea1e92f6b2fb04d8059ff364cabf9c08fba1e4dae71')

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

check() {
	cd "$_archive"
	PYTHONPATH="$PWD/src" pytest
}

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