# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-tcxparser
_pkgorig=python-tcxparser
pkgver=2.4.0
pkgrel=1
pkgdesc="Simple parser for Garmin TCX files"
url="https://github.com/vkurup/python-tcxparser"
arch="noarch"
license="BSD-2-Clause"
depends="python3 py3-lxml py3-dateutil"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest-xdist"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://github.com/vkurup/python-tcxparser/archive/$pkgver/$_pkgorig-$pkgver-r1.tar.gz"
builddir="$srcdir/$_pkgorig-$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 -n auto
}

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

	install -Dm644 README.rst -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
b5921a2987aedf20165600db541f60f21f221493047206e0bffb5ffe97c7c4ce4471efdf7d9e35993c4ca2ac7ad280f3a357a9a1e10f9089781fca4357147b94  python-tcxparser-2.4.0-r1.tar.gz
"
