# Contributor: omni <omni+alpine@hack.org>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=py3-urwid_readline
_pkgname=urwid_readline
pkgver=0.15.1
pkgrel=0
pkgdesc="text input widget for urwid that supports readline shortcuts"
url="https://github.com/rr-/urwid_readline"
arch="noarch"
license="MIT"
depends="python3 py3-urwid"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-runner"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/rr-/urwid_readline/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$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="
91fd2e1fabf65755cc0fb28b772f72cc1cb533f3a1d30099f4aad2d6a68ca7b4e2476f33029b31ff772533ecb2c47e0caa049634d99e760eea831a502f224f86  py3-urwid_readline-0.15.1.tar.gz
"
