# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=cligj
pkgname=python-${_pkg}
pkgver=0.7.2
pkgrel=8
pkgdesc="Click-based argument and option decorators for Python GIS command line programs"
arch=(any)
url="https://github.com/mapbox/cligj"
license=(BSD-3-Clause)
depends=(python-click)
makedepends=(python-build python-installer python-setuptools python-wheel)
checkdepends=(python-pytest)
source=(https://files.pythonhosted.org/packages/source/${_pkg::1}/${_pkg}/${_pkg}-${pkgver}.tar.gz)
sha256sums=('a4bc13d623356b373c2c27c53dbd9c68cae5d526270bfa71f6c6fa69669c6b27')

build() {
  cd ${_pkg}-${pkgver}
  python -m build --wheel --no-isolation
}

check() {
  cd ${_pkg}-${pkgver}
  PYTHONPATH="${PWD}" pytest
}


package() {
  cd ${_pkg}-${pkgver}
  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}
}
