# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-shellingham
_realname=${pkgname/py3-/}
pkgver=1.5.4
pkgrel=1
pkgdesc="Python3 module to poke around and find out running shell"
url="https://github.com/sarugaku/shellingham"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-mock"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/sarugaku/shellingham/archive/$pkgver.tar.gz"
builddir="$srcdir/$_realname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
5a56156add14a5ec9cb55ccf0a268f6c64a3e2fec90301ea31f499131560fa537ca3b3544f18944efac451fa21826114a2bbf3b54140d294d94e7ae890964800  py3-shellingham-1.5.4.tar.gz
"
