# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-elementpath
pkgver=5.0.4
pkgrel=1
pkgdesc="XPath 1.0/2.0 parsers and selectors for ElementTree and lxml"
url="https://github.com/sissaschool/elementpath"
license=('MIT')
arch=('any')
depends=('python')
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools')
checkdepends=('python-lxml' 'python-pytest' 'python-xmlschema')
source=("git+https://github.com/sissaschool/elementpath.git#tag=v$pkgver")
sha512sums=('4eefdb6fcba8bfe567e17e9ec84a44105d9122834c1bc0b9bbb444d0b50b7c6edd9d150931fe0c6e91b749caec1ad7086cffdb92d1dc171c328c6fd4ceea9301')

build() {
  cd elementpath
  python -m build -nw
}

check() {
  cd elementpath
  python -m pytest
}

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