# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=pgsanity
pkgver=0.2.9
pkgrel=7
pkgdesc="Check the syntax of Postgresql SQL files"
url="https://github.com/markdrago/pgsanity"
arch="noarch"
license="MIT"
depends="python3 cmd:ecpg"
makedepends="py3-gpep517 py3-setuptools"
subpackages="$pkgname-pyc"
source="https://github.com/markdrago/pgsanity/archive/v$pkgver/pgsanity-$pkgver.tar.gz"

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 unittest -v
}

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

sha512sums="
909a12684f386f023e1e1b2ecbd988eba023597509483b467c411690d42fa2da912e8b7634d9ef600ca9a2770f77f02b07bbadb378f50c6c31cc0b8003c9b83b  pgsanity-0.2.9.tar.gz
"
