# Contributor: Sasha Gerrand <alpine-pkgs@sgerrand.com>
# Maintainer: Sasha Gerrand <alpine-pkgs@sgerrand.com>
pkgname=py3-schema
pkgver=0.7.5
pkgrel=4
pkgdesc="Schema is a library for validating Python data structures"
url="https://github.com/keleshev/schema"
arch="noarch"
license="MIT"
depends="python3"
checkdepends="py3-pytest py3-mock"
makedepends="py3-setuptools py3-gpep517"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/keleshev/schema/archive/v$pkgver.tar.gz"
builddir="$srcdir/schema-$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
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
360669128595104ece7295769d29e57218cc49342e3744289389a3e62bfa66b2f086a52cafb1d6fb8ce1d8744d205045a384d7da3814f92ee7dfdf8acd5617d5  py3-schema-0.7.5.tar.gz
"
