# Maintainer: Marian Buschsieweke <marian.buschsieweke@posteo.net>
pkgname=py3-commentjson
pkgver=0.9.0
pkgrel=2
pkgdesc="helps creating JSON files with Python and JavaScript style inline comments"
url="https://github.com/vaidik/commentjson"
arch="noarch"
license="MIT"
depends="
	python3
	py3-lark-parser
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-six
	python3-tests
	"
subpackages="$pkgname-pyc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/vaidik/commentjson/archive/refs/tags/v$pkgver.tar.gz
	update-test-skips-for-python-3.12.patch
	"
builddir="$srcdir/commentjson-$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 unittest discover
}

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

	rm -r "$pkgdir"/usr/lib/python3*/site-packages/commentjson/tests
}

sha512sums="
cd3d28adecbc445ed3faed7847c65a23829f408cf8aa3fa85544a0f0cf9fa5544b8aff560725cf51921f249123daf9ce9953069e99ca64a312bb4bff652512fe  py3-commentjson-0.9.0.tar.gz
04c87f6cb556a0d59da728c9098b4e40a7878628ab85fb159928a4d7951b9eace22da63997825989368fafd7250decfd234b6a2f45496d86db091c5c0963cbdc  update-test-skips-for-python-3.12.patch
"
