# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
#
# NOTE: yq and yq-go are NOT interchangeable, they have quite different CLI
#  and syntax. Most distros package this Python implementation as "yq".
pkgname=yq-python
pkgver=3.2.3
pkgrel=0
pkgdesc="jq wrapper for YAML/XML/TOML documents"
url="https://github.com/kislyuk/yq"
arch="noarch"
license="Apache-2.0"
depends="
	!yq-go
	jq
	py3-pyaml
	py3-xmltodict
	py3-tomlkit
	py3-argcomplete
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/kislyuk/yq/archive/v$pkgver/yq-$pkgver.tar.gz"
builddir="$srcdir/yq-$pkgver"

build() {
	echo "version = '$pkgver'" > yq/version.py

	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 ./test/test.py -v
}

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

sha512sums="
6238746d59511577fb0368ab43e3593c60dfb40dfebd7a01e475abf7171d27f7e0d2de9b03a3d95a554d82e181ddaf3cd030020853e7c9efad2f77914ea9c0ad  yq-3.2.3.tar.gz
"
