# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Simon Sapin <simon dot sapin at exyr dot org>
# Contributor: Kyle Keen <keenerd@gmail.com>

pkgname=python-cssselect2
_name="${pkgname#python-}"
pkgver=0.7.0
pkgrel=6
pkgdesc="CSS selectors for Python ElementTree"
url="https://github.com/Kozea/cssselect2/"
license=('BSD-3-Clause')
arch=(any)
depends=('python' 'python-tinycss2' 'python-webencodings')
makedepends=('python-build' 'python-flit-core' 'python-installer')
checkdepends=('python-pytest')
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz")
sha512sums=('21e4b36fe10d87a1a5cfd9fdde54ba8dfc4c1bbb977f5cf2a8ade849c0f197f6e33d9b6de05df73a2f3b4756302c5162f44ca1ce37588f157bce0dc54c33f687')

build() {
  cd $_name-$pkgver
  python -m build -nw
}

check() {
  cd $_name-$pkgver
  pytest
}

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