# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-validate-pyproject
pkgver=0.23
pkgrel=0
pkgdesc="Validation library for simple check on pyproject.toml"
url="https://validate-pyproject.readthedocs.io"
arch="noarch"
license="MPL-2.0"
depends="
	py3-fastjsonschema
	python3
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="py3-pytest-xdist"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/abravalheri/validate-pyproject/archive/refs/tags/v$pkgver.tar.gz
	no-useless-check.patch
	"
builddir="$srcdir/validate-pyproject-$pkgver"
options="net" # tests require network

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 -n auto -k 'not test_downloaded and not test_private_classifier'
}

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

sha512sums="
d62ec5799a31da5abb550c51308cb07a7a8185262136cb9fd066e17c611b7923fca9c8217866ff5defe20b9df299e1ae72c70f3ed74c396c5ae61045c458de5d  py3-validate-pyproject-0.23.tar.gz
1c538f93301c30cd5a62011692fb33e6638f4167ab3365f0dbb0f6857f75baf2131b959db2ff55c2ef81d8c1df38566220cd8e029b4fb61441f27005e4cd6798  no-useless-check.patch
"
