# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-jsondiff
pkgver=2.2.1
pkgrel=0
pkgdesc="Diff JSON and JSON-like structures in Python"
url="https://github.com/xlwings/jsondiff"
arch="noarch"
license="MIT"
depends="py3-yaml"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-hypothesis"
subpackages="$pkgname-pyc"
source="https://github.com/xlwings/jsondiff/archive/$pkgver/py3-jsondiff-$pkgver.tar.gz"
builddir="$srcdir/jsondiff-$pkgver"

build() {
	printf '__version__ = "%s"\n' "$pkgver" > jsondiff/_version.py
	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="
e10ed1f1b11b877223936586c1805cb8b8ae3f487f913f4d33030ae6e87a06a54f1f9adfb2b50485d72123f2feb6b40aa019851a6c9fd83575cc0f0b814484f7  py3-jsondiff-2.2.1.tar.gz
"
