# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-param
pkgver=2.2.0
pkgrel=0
pkgdesc="Make your Python code clearer and more reliable by declaring Parameters"
url="https://github.com/holoviz/param"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-gpep517 py3-hatchling py3-hatch-vcs py3-wheel"
checkdepends="py3-pytest-asyncio py3-pytest-cov py3-flake8"
subpackages="$pkgname-doc $pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/holoviz/param/archive/v$pkgver/param-$pkgver.tar.gz"
builddir="$srcdir/param-$pkgver"
options="!check" # skip for now | deprecations in asyncio

case "$CARCH" in
# several test fails on two architectures | skip for now
ppc64le | riscv64) options="$options !check" ;;
esac

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	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 testreactive.py' --ignore=tests/testjsonserialization.py
}

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

	install -Dm644 ./*.md -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
1e52af40753ba470cdc1563f25dd16982469d1fbb2c6f712a44d70d6cfddb8ccbf65543eb42310bcc57cbe05e3dd816a1f9aee34ec3f9779c44ce1d0258b0b6a  py3-param-2.2.0.tar.gz
"
