# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Chris Severance aur.severach AatT spamgourmet.com
# Contributor: Chris Fordham <chris [at] fordham-nagy [dot] id [dot] au> aka flaccid
# Package Source: https://github.com/flaccid/archlinux-packages/blob/master/python-jmespath/PKGBUILD

pkgname=python-jmespath
pkgver=1.1.0
pkgrel=1
pkgdesc='A query language for JSON'
arch=(any)
url='https://github.com/jmespath/jmespath'
license=(Apache-2.0)
depends=(python)
makedepends=(
  git
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(
  python-hypothesis
  python-pytest
)
source=("$pkgname::git+$url#tag=$pkgver")
sha512sums=('7074e01961f0d4a11015d32a26c9e56b3627105b4875755b622a480df255765de944f0dba5b17b9b46d329d68003928b1c28f6d8ad7e4ad352f743bac5cad8d7')
b2sums=('efc8be9db0ecfcfdb394e3d18783f9ed9be2b682b3d8c26586c61bc5dc45b31bafb5979b89cdd346144af4c59947e160022697057881dfa363b62c46517cea2f')

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

check() {
  cd "$pkgname"

  # Their tox.ini is misleading...
  pytest -v tests/
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl
}
