# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-ast-monitor
pkgver=0.5.5
pkgrel=0
pkgdesc="A wearable Raspberry Pi computer for cyclists"
url="https://github.com/firefly-cpp/AST-Monitor"
# below blocked by py3-pyqt6-webengine -> qt6-qtwebengine
arch="noarch !armv7 !armhf !ppc64le !riscv64 !s390x"
license="MIT"
depends="
	python3
	py3-geopy
	py3-matplotlib
	py3-pyqt-feedback-flow
	py3-qt6
	py3-pyqt6-webengine
	py3-sport-activities-features
	py3-tcxreader
	"
checkdepends="py3-pytest py3-pytest-qt"
makedepends="py3-gpep517 py3-poetry-core"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://github.com/firefly-cpp/AST-Monitor/archive/$pkgver/ast_monitor-$pkgver.tar.gz"
builddir="$srcdir/AST-Monitor-$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 -k 'not test_gui'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	install -Dm644 docs/preprints/2109-13334.pdf -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 HARDWARE_CONFIGURATION.md -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 README.md -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 CITATION.cff -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 CONTRIBUTING.md -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
fa175c7a84a193d4e3bdcadaeb6c28cf362e0963cd8650dd99a8f3c225ee3397db5173d13a603d1c12b7d173c984591e6bfa858012611b88c871e15d4c037cd1  ast_monitor-0.5.5.tar.gz
"
