# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-fitparse
_pkgorig=fitparse
pkgver=1.2.0
pkgrel=4
pkgdesc="Python library to parse ANT/Garmin .FIT files"
url="https://github.com/dtcooper/python-fitparse"
arch="noarch"
license="MIT"
depends="python3"
checkdepends="py3-pytest-xdist"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://github.com/dtcooper/python-fitparse/archive/v$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/python-$_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 -k 'not test_utils'
}

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

sha512sums="
45f84986ae4ed2af7110481e9b3e601a0455e2e0fb35ca6f83ded312caebe195013b69614ccfa39118bad9606414f99f7edf7514c53d545166f242815e9431b9  fitparse-1.2.0.tar.gz
"
