# Contributor: prspkt <prspkt@protonmail.com>
# Maintainer: prspkt <prspkt@protonmail.com>
pkgname=py3-parsel
_pkgname=parsel
pkgver=1.9.0
# maintainer did not push git tag
_gittag=712fa3d3f99a5cc69db7dd653d2b575f8d6c5c59
pkgrel=1
pkgdesc="Library to extract data from HTML and XML using XPath and CSS selectors"
url="https://github.com/scrapy/parsel"
arch="noarch"
license="BSD-3-Clause"
depends="python3 py3-cssselect py3-jmespath py3-lxml py3-w3lib py3-packaging"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
checkdepends="py3-pytest py3-sybil py3-psutil py3-pytest-runner"
subpackages="$pkgname-pyc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/scrapy/parsel/archive/$_gittag.tar.gz"
builddir="$srcdir"/$_pkgname-$_gittag

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer "$builddir"/.dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
524cb97254ed601a027d2ca4b0b73de33385f42bf974b6e62cb984498a6467e1c330772f49ee687ca62c90183dccf68ae06b00e3f17604a206cc4b57ef0a80f0  parsel-1.9.0.tar.gz
"
