# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-ijson
pkgver=3.4.0
pkgrel=0
pkgdesc="Iterative JSON parser with standard Python iterator interfaces"
url="https://github.com/ICRAR/ijson"
arch="all"
license="BSD-3-Clause"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	yajl-dev
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/ICRAR/ijson/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/ijson-$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
}

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

sha512sums="
5929d8e02f7a547f1124638f2709c6386342932951c923653f47391a684020abf18fbca912debefd3b828bbaee2d3720ab76d41a5bb4731df0c79d63edb084ac  py3-ijson-3.4.0.tar.gz
"
