# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-jsonschema-specifications
pkgver=2024.10.1
pkgrel=0
pkgdesc="Support files exposing JSON from the JSON Schema specifications to Python"
url="https://github.com/python-jsonschema/jsonschema-specifications"
arch="noarch"
license="MIT"
depends="
	py3-referencing
	"
makedepends="
	py3-gpep517
	py3-hatch-vcs
	py3-hatchling
	"
checkdepends="
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/python-jsonschema/jsonschema-specifications/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/jsonschema-specifications-$pkgver"

build() {
	SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver \
		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
	rm -r "$pkgdir"/usr/lib/python*/site-packages/jsonschema_specifications/tests/
}

sha512sums="
3fff5849bfe13748928791139bf12e132c21f1e292a6c2017c057987f7772f5d9628d9a9be46373071417112ccb05d998748b4965b68dd466b326945372425f2  py3-jsonschema-specifications-2024.10.1.tar.gz
"
