# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-confection
pkgver=0.1.5
pkgrel=0
pkgdesc="Confection: the sweetest config system for Python"
url="https://github.com/explosion/confection"
arch="noarch"
license="MIT"
depends="
	python3
	py3-pydantic
	py3-srsly
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
subpackages="$pkgname-doc $pkgname-pyc"
checkdepends="
	py3-catalogue
	py3-pytest-runner
	py3-pytest-xdist
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/explosion/confection/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/confection-$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
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

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

	install -vDm644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"

	rm -r "$pkgdir"/usr/lib/python3*/site-packages/confection/tests
}

sha512sums="
62fa0c19f7e9f9be1945b50cab2f4da17df96489391bf95a67878c53ba886ae13751d4e4f6a9548bc10cc35d0008f6899cac9362b5cf029ca0713b709c73ee3e  py3-confection-0.1.5.tar.gz
"
