# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Contributor: fossdd <fossdd@pwned.life>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=py3-beautifulsoup4
_pkgname=beautifulsoup4
pkgver=4.12.3
pkgrel=3
pkgdesc="A Python HTML/XML parser"
url="https://www.crummy.com/software/BeautifulSoup/index.html"
arch="noarch"
license="MIT"
depends="python3 py3-soupsieve"
makedepends="
	py3-gpep517
	py3-hatchling
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/b/beautifulsoup4/beautifulsoup4-$pkgver.tar.gz
	Changes-to-make-tests-work-whether-tests-are-run-und.patch"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-beautifulsoup4" # Backwards compatibility
provides="py-beautifulsoup4=$pkgver-r$pkgrel" # Backwards compatibility

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

check() {
	python3 -m pytest -s bs4
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	rm -r "$pkgdir"/usr/lib/python3*/site-packages/bs4/tests
}

sha512sums="
b5b6cc9f64a97fa52b9a2ee1265aa215db476e705d3d79e49301de7e8d36c56c96924cb440eec0715f7ec75c5ddf4c1ade9d6cef7cdc9bf9e37125ac6eb50837  beautifulsoup4-4.12.3.tar.gz
3c16c547b995e1172c34473907d5f2f400d2828e1486106c13a98bdeb59df4a0004750365da3ffff0bc390e640b7cea7c85945e5872381acd72a6ca141987779  Changes-to-make-tests-work-whether-tests-are-run-und.patch
"
