# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-pytoolconfig
pkgver=1.3.1
pkgrel=1
pkgdesc="Python tool configuration"
url="https://github.com/bagel897/pytoolconfig"
arch="noarch"
license="LGPL-3.0-or-later"
depends="
	py3-docutils
	py3-packaging
	py3-platformdirs
	py3-sphinx
	py3-tabulate
	python3
	"
makedepends="py3-gpep517 py3-pdm-backend py3-installer"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/bagel897/pytoolconfig/archive/v$pkgver/py3-pytoolconfig-$pkgver.tar.gz"
builddir="$srcdir/pytoolconfig-$pkgver"

build() {
	export PDM_BUILD_SCM_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages test-env
	test-env/bin/python3 -m installer .dist/*.whl
	test-env/bin/python3 -m pytest
}

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

sha512sums="
39aea3ffa9cd625a665c1f768348482c6bc9b850225137961cc6306d40c56272bd01e1f4b7ed391deebf5cdbd0496e9dee0691a5f3460a53ed1fbe0cc6e2d3cd  py3-pytoolconfig-1.3.1.tar.gz
"
