# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-colored
_pyname=${pkgname/py3-/}
pkgver=2.3.0
pkgrel=0
pkgdesc="Simple Python library for color and formatting in terminal"
url="https://gitlab.com/dslackw/colored"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-setuptools py3-gpep517 py3-flit"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="
	https://gitlab.com/dslackw/colored/-/archive/$pkgver/colored-$pkgver.tar.gz
	tests-set-tty-aware-false.patch
	"
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 "$builddir"/.dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
f4686ead8a11f30af1fb92642e77dd53c6ff9b7b10738273c3acc17a8f8828ab689e668fed6f57fb48a74a5a7ed6c88909ac1b81f6e92df719c64caf93829587  colored-2.3.0.tar.gz
6bb507d9f336938d2e0a999d9f5dbec890d0530cf40ea47c52e5b25b388ec9668dd6ba2b2e76d6fd97c7f20ff8c34a07ee5cf80b849429b1e90030f2c9aa1be2  tests-set-tty-aware-false.patch
"
