# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-coloredlogs
pkgver=15.0.1
pkgrel=4
pkgdesc="Colored terminal output for Python's logging module"
url="https://coloredlogs.readthedocs.io/en/latest/"
arch="noarch"
license="MIT"
depends="python3 py3-humanfriendly"
makedepends="py3-setuptools"
checkdepends="py3-capturer py3-pytest py3-verboselogs"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/c/coloredlogs/coloredlogs-$pkgver.tar.gz"
builddir="$srcdir/coloredlogs-$pkgver"

case "$CARCH" in
s390x)
	# no py3-verboselogs
	options="$options !check"
	;;
esac

build() {
	python3 setup.py build
}

check() {
	#deselected tests need script from github tarball
	PYTHONWARNINGS="ignore::DeprecationWarning" \
	pytest --deselect=coloredlogs/tests.py::ColoredLogsTestCase::test_auto_install \
		--deselect=coloredlogs/tests.py::ColoredLogsTestCase::test_cli_conversion \
		--deselect=coloredlogs/tests.py::ColoredLogsTestCase::test_empty_conversion \
		--deselect=coloredlogs/tests.py::ColoredLogsTestCase::test_output_interception \
		coloredlogs/tests.py

}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
	find "$pkgdir" -name "*tests*" -delete
}

sha512sums="
577af26af8d27bca3f10e6aaa257245aba608cc3832985ba57bcb2b590b10bf054796a2210749c15ee1b1a17623e007e4ac3ba17bed6af95544f85f5dfafaf21  coloredlogs-15.0.1.tar.gz
"
