# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-validate-pyproject
pkgver=0.24.1
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="
d1560b154e498d4ee573b263231d73dcfd932a1ff105541ab3a42628ee8643b8256e50d505ca952fed485df99d49bf60065984ba77167912484baf796674f8e4  py3-validate-pyproject-0.24.1.tar.gz
1c538f93301c30cd5a62011692fb33e6638f4167ab3365f0dbb0f6857f75baf2131b959db2ff55c2ef81d8c1df38566220cd8e029b4fb61441f27005e4cd6798  no-useless-check.patch
"
