# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-extruct
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=extruct
pkgver=0.17.0
pkgrel=0
pkgdesc="Extract embedded metadata from HTML markup"
url="https://pypi.python.org/project/extruct"
license="BSD-3-Clause"
arch="noarch"
depends="
		py3-lxml
		py3-pyrdfa3
		py3-mf2py
		py3-w3lib
		py3-html-text
		py3-six
		py3-jstyleson
		py3-requests
		"
checkdepends="py3-pytest"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
source="$pkgname-$pkgver.tar.gz::https://github.com/scrapinghub/extruct/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"
subpackages="$pkgname-pyc"

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="
e99d72934801391e596edbef8e8771c645f57964532e48aaaa6f5253b6d53676ef36bc95820a40dd45a3e26b42a407a00fcdb51510d146809e7b40bd991e24e3  py3-extruct-0.17.0.tar.gz
"
