# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-tcx2gpx
pkgver=0.1.5
pkgrel=2
pkgdesc="Convert Garmin TCX GPS tracks to GPX"
url="https://gitlab.com/nshephard/tcx2gpx"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	python3
	py3-dateutil
	py3-gpxpy
	py3-tcxparser
	py3-tqdm
	"
makedepends="py3-gpep517 py3-setuptools_scm py3-wheel"
checkdepends="py3-pytest-xdist py3-pytest-cov"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/t/tcx2gpx/tcx2gpx-$pkgver.tar.gz"
builddir="$srcdir/tcx2gpx-$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
}

sha512sums="
17df07bbe7e23c1017e34de843b2887fc8475dd706d5650dbaae4a18093caa6b157af1616a976426e8995694d86d353097fa8ca3960e4fac88e26035375719dc  py3-tcx2gpx-0.1.5.tar.gz
"
