# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-openapi-schema-validator
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=openapi-schema-validator
pkgver=0.6.3
pkgrel=0
pkgdesc="OpenApi schema validation for OpenApi versions v2, v3.0.x and v3.1.x"
url="https://github.com/python-openapi/openapi-schema-validator"
arch="noarch"
license="Apache-2.0"
depends="
	py3-jsonschema
	py3-jsonschema-specifications
	py3-rfc3339-validator
"
checkdepends="
	py3-pytest
	py3-pytest-cov
"
makedepends="
	poetry
	py3-setuptools
	py3-gpep517
	py3-wheel
"
subpackages="$pkgname-pyc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/python-openapi/openapi-schema-validator/archive/refs/tags/$pkgver.tar.gz
"
builddir="$srcdir/$_pkgreal-$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 "$builddir"/.dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

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

sha512sums="
ace21595170c7eb27680351a7c61fb26c3822d85680b8dc7c37527a149a66f12ba6447ddebecec24abf62eeb43e24e143725d435b500d34eb9e155efed840cc9  py3-openapi-schema-validator-0.6.3.tar.gz
"
