# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-fastjsonschema
pkgver=2.21.1
pkgrel=0
pkgdesc="Fast JSON schema validator"
url="https://horejsek.github.io/python-fastjsonschema/"
arch="noarch"
license="BSD-3-Clause"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-benchmark"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/horejsek/python-fastjsonschema/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/python-fastjsonschema-$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="
5d6b27a5c914007d716594b13b05251d986c0b922f47336ca875928eecb6df40c3473026243eeee18d3dc1b3276de6f64eb1529c3f697771f755f8531233eed3  py3-fastjsonschema-2.21.1.tar.gz
"
