# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-tblib
pkgver=3.0.0
pkgrel=1
pkgdesc="Serialization library for Exceptions and Tracebacks"
url="https://github.com/ionelmc/python-tblib"
arch="noarch"
license="BSD-2-Clause"
depends="py3-six"
makedepends="
	py3-docutils
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	"
checkdepends="
	py3-pytest
	py3-twisted
	"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/t/tblib/tblib-$pkgver.tar.gz
	0001-$pkgname-Loosen-up-test.patch::https://github.com/ionelmc/python-tblib/commit/04dc5426812c508a10774122450acf386e546dbf.patch
	0002-$pkgname-More-aggressive-location-stripping.patch::https://github.com/ionelmc/python-tblib/commit/66e14cdd101e4214cca6acca8f48b9abe4f75729.patch
	"
builddir="$srcdir/tblib-$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
	.testenv/bin/python3 -m pytest
}

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

sha512sums="
9914709846a4a9b0d9fe0f58eb321085f69e11ce364930f67cc5fec008d6ca57963b17699b0a136e2de91ff01004275fc43a38f318b9faab7cb2fac861108297  tblib-3.0.0.tar.gz
f0fdd3e892fecd11f9799a3d9051fa4c70effbef54018794613b0f1ef00b269c991d5ba37a964d527a60f92d6873083ce91ca0870433ed0de3f4e5c94f31840b  0001-py3-tblib-Loosen-up-test.patch
e04079f94fff47595b4b8897c6654ec37cb19df4469ee1f9397ca7607e3fb260c896dbb117b5839a887420fd94fc1ad09467ee4aaf62c2dbd7cb20ce4384faa5  0002-py3-tblib-More-aggressive-location-stripping.patch
"
