# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-sport-activities-features
pkgver=0.4.3
pkgrel=0
pkgdesc="A minimalistic toolbox for extracting features from sport activity files"
url="https://github.com/firefly-cpp/sport-activities-features"
arch="noarch"
license="MIT"
depends="
	python3
	py3-geopy
	py3-geotiler
	py3-gpxpy
	py3-matplotlib
	py3-niaaml
	py3-overpy
	py3-tcx2gpx
	py3-tcxreader
	"
checkdepends="py3-pytest"
makedepends="py3-gpep517 py3-poetry-core"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://github.com/firefly-cpp/sport-activities-features/archive/$pkgver/sport-activities-features-$pkgver.tar.gz"
builddir="$srcdir/sport-activities-features-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	# exclude network tests
	python3 -m pytest -k "not test_weather and not overpy_node_manipulation and not test_data_analysis"
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/sport_activities_features-$pkgver-py3-none-any.whl

	install -Dm644 docs/preprints/A_minimalistic_toolbox.pdf -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 CITATION.cff -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
56d3841edad38f053ab7cbe428d302438cbdc830eb6bd7f055fd20fc3239e7aababda1bb2306df7f9be1a8b7c384d7b11a71baae35cccafa509a566645e1967b  sport-activities-features-0.4.3.tar.gz
"
