# Maintainer: Alistair Francis <alistair@alistair23.me>
pkgname=py3-meshtastic
_pyname=meshtastic
pkgver=2.6.0
pkgrel=1
pkgdesc="Python API & client shell for talking to Meshtastic devices"
url="https://github.com/meshtastic/python"
# Depends on py3-dash
arch="all !s390x !x86 !armhf !armv7 !loongarch64 !riscv64 !ppc64le"
license="GPL-3.0-only"
depends="
	python3
	py3-protobuf
	py3-pyserial
	py3-dotmap
	py3-pyqrcode
	py3-tabulate
	py3-webencodings
	py3-requests
	py3-parsing
	py3-pypubsub
	py3-bleak
	py3-print-color
	py3-pytest-asyncio
	py3-yaml
	py3-hypothesis
	py3-pytap2
	py3-parse
	py3-pyarrow
	py3-ppk2-api
	"
makedepends="
	py3-gpep517
	py3-installer
	py3-poetry-core
	py3-wheel
	py3-bleak
	py3-pytest-asyncio
	"
checkdepends="
	py3-dash
	py3-pexpect
	py3-pytest
	py3-pytest-asyncio
	py3-setuptools
	py3-dash-bootstrap-components
	"
source="py3-meshtastic-$pkgver.tar.gz::https://github.com/meshtastic/python/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir"/python-$pkgver

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 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 \
		--ignore=meshtastic/tests/test_analysis.py \
		--ignore=meshtastic/tests/test_mesh_interface.py
}

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

sha512sums="
fe34a465954d4bb519fd85626b67140089a5e3cf3bf0377f72ace29bd65f42a7d93eb94a32ead3731abded264513a8843e1521ee0c7b3c93530381b6bbfbb686  py3-meshtastic-2.6.0.tar.gz
"
