# Contributor: 6543 <6543@obermui.de>
# Maintainer: 6543 <6543@obermui.de>
pkgname=check-jsonschema
pkgver=0.28.4
pkgrel=0
pkgdesc="A JSON Schema CLI built on jsonschema. The schema may be specified as a local or remote (HTTP or HTTPS) file"
url="https://github.com/python-jsonschema/check-jsonschema"
# s390x: blocked by py3-regress
arch="all !s390x"
license="Apache-2.0"
depends="
	py3-jsonschema
	py3-regress
	py3-requests
	py3-ruamel
	py3-responses
	py3-click
	python3
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/python-jsonschema/check-jsonschema/archive/refs/tags/$pkgver.tar.gz"

options="!check" # check fail but cli work as expected

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="
f4c693ea0951c246814775f26d5c3e5de8020484a92ae15e2a13e284ccb2c58f2bdf7dbdb66612661304f5ff9e6ba88eb3f89e7f0ad23a3f6fc8fcc61372ceea  check-jsonschema-0.28.4.tar.gz
"
