# Maintainer: fossdd <fossdd@pwned.life>
pkgname=py3-itemloaders
pkgver=1.3.2
pkgrel=0
pkgdesc="Library to populate items using XPath and CSS with a convenient API"
url="https://github.com/scrapy/itemloaders"
arch="noarch"
license="BSD-3-Clause"
depends="
	py3-itemadapter
	py3-jmespath
	py3-parsel
	py3-w3lib
	python3
	"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/scrapy/itemloaders/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/itemloaders-$pkgver"

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 .dist/*.whl
	.testenv/bin/python3 -m pytest
}

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

sha512sums="
cc5b68234f65db1452966ca29cb58856f939d836db9e835f3ede89b933731d1a08a9c58c0cb7196bdb9958ede67e7bd010e852411f66f47fd8e2e046e56d34a9  py3-itemloaders-1.3.2.tar.gz
"
