# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-rich
pkgver=13.9.4
pkgrel=0
pkgdesc="Python library for rich text formatting and terminal formatting"
url="https://rich.readthedocs.io/en/latest/"
arch="noarch"
license="MIT"
depends="
	py3-markdown-it-py
	py3-pygments
	"
makedepends="py3-gpep517 py3-installer py3-poetry-core py3-wheel"
checkdepends="py3-pytest py3-setuptools"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Textualize/rich/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/rich-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 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 -k 'not test_python_render_simple_indent_guides and not test_python_render_line_range_indent_guides' \
		--deselect=tests/test_console.py::test_brokenpipeerror
}

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

sha512sums="
36d9f0442759784453a75c9a80cd3dde113db5544d62da1eb85bc0572c16b6247da9b5254246fa571007ce0e70a234aea2ab1ed5dc20c1ec23084070733d39a1  py3-rich-13.9.4.tar.gz
"
