# Contributor: Matt Smith <mcs@darkregion.net>
# Maintainer: Matt Smith <mcs@darkregion.net>
pkgname=py3-urwid
_pyname=urwid
pkgver=2.6.13
pkgrel=0
pkgdesc="A console user interface library for Python3"
url="https://urwid.org/"
arch="all"
license="LGPL-2.1-only"
depends="
	py3-typing-extensions
	py3-wcwidth
	"
makedepends="
	python3-dev
	py3-gpep517
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="
	py3-pytest-cov
	py3-pyzmq
	py3-tornado
	py3-trio
	py3-twisted
	"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/u/$_pyname/$_pyname-$pkgver.tar.gz"
builddir="$srcdir"/$_pyname-$pkgver

replaces="py-urwid" # Backwards compatibility
provides="py-urwid=$pkgver-r$pkgrel" # Backwards compatibility

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 unittest
}

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

sha512sums="
9989c3f906cca38a32baccef3c4717deb964f15b5cb08135be75d3e2a5a26f4d64cfe6cc2f58cba5e0ba8da1fb52ef71a591a88dbed9f8e2c80960933dff3537  urwid-2.6.13.tar.gz
"
