# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=toml-adapt
pkgver=0.3.4
pkgrel=0
pkgdesc="A simple command-line interface (CLI) for manipulating toml files"
url="https://github.com/firefly-cpp/toml-adapt"
arch="noarch"
license="MIT"
depends="python3 py3-toml py3-click"
checkdepends="py3-pytest-xdist"
makedepends="py3-gpep517 py3-poetry-core"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://github.com/firefly-cpp/toml-adapt/archive/$pkgver/toml-adapt-$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 pytest -n auto
}

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

	install -Dm644 toml-adapt.1 -t "$pkgdir"/usr/share/man/man1/
	install -Dm644 CITATION.cff -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
a3f1e4099c0477005af3fb835a15a3e07a5a8155782b960e53fd571f93d767c63c817d7d12e846317dfe5a3695433cd3ea187ac1e9220e301cd890d98a8f5de4  toml-adapt-0.3.4.tar.gz
"
