# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-fitfile
_pkgorig=fitfile
pkgver=1.1.8
pkgrel=0
pkgdesc="Decode/parse Garmin's FIT format files"
url="https://github.com/tcgoetz/Fit"
arch="noarch"
license="GPL-2.0-or-later"
depends="python3"
checkdepends="
	py3-pytest-xdist
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/f/fitfile/fitfile-$pkgver.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 --destdir="$pkgdir" .dist/*.whl
}

sha512sums="
ddbd274cc5ac8bf0f1800f27d5f91972162648820aeb366f22d1391997ce686cb1ea91e84c227dfa83ef3cb0e861124835f59494030d0b32c478a7b86a583c7b  py3-fitfile-1.1.8.tar.gz
"
