# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=py3-term-image
_pyname=term-image
pkgver=0.7.2
pkgrel=0
pkgdesc="Display images in the terminal with Python"
url="https://github.com/AnonymouX47/term-image"
arch="noarch"
license="MIT"
depends="py3-pillow py3-requests"
checkdepends="py3-pytest py3-urwid"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="$_pyname-$pkgver.tar.gz::https://github.com/AnonymouX47/term-image/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$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
	# test_url uses network
	.testenv/bin/python3 -m pytest --deselect tests/test_image/test_url.py
}

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

sha512sums="
0d8e15652919621b34002f1222882da8dd0f8797cf268e03ac5685eea783e71e0262058a30104fea91b696399a6df6720430f8dc044124ce8fa1103e919a7d56  term-image-0.7.2.tar.gz
"
