# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Daurnimator <daurnimator@archlinux.org>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Daniel M. Capella <polyzen@archlinux.org>

pkgname=yq
pkgver=3.4.1
pkgrel=1
pkgdesc="Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents"
arch=('any')
url="https://github.com/kislyuk/yq"
license=('Apache')
depends=('jq'
         'python-argcomplete'
         'python-tomlkit'
         'python-xmltodict'
         'python-yaml')
makedepends=('python-build' 'python-installer' 'python-setuptools-scm' 'python-wheel')
conflicts=('go-yq')
source=("https://files.pythonhosted.org/packages/source/y/$pkgname/$pkgname-$pkgver.tar.gz")
sha256sums=('b558dab6f15c03e24a1c448789500b20d6f307ee9ca4c9361387f3658163000d')
b2sums=('628fbb62de0c2f138133444c2f371819f920ac3d7c89787b96cb2de59eaa49f1324227d53f6d33e29dd9a9a804283339b34d87851c6f32a16a1cc94a7451a726')

build() {
  cd $pkgname-$pkgver
  python -m build -wn
}

check() {
  cd $pkgname-$pkgver
  python test/test.py
}

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