# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Contributor: fossdd <fossdd@pwned.life>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=py3-beautifulsoup4
_pkgname=beautifulsoup4
pkgver=4.13.4
pkgrel=0
pkgdesc="A Python HTML/XML parser"
url="https://www.crummy.com/software/BeautifulSoup/index.html"
arch="noarch"
license="MIT"
depends="python3 py3-soupsieve py3-typing-extensions"
makedepends="
	py3-gpep517
	py3-hatchling
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/b/beautifulsoup4/beautifulsoup4-$pkgver.tar.gz"
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="
7763e7e8528db54c48d29cd300155fc6d5b69785d3ea7d6ca14427b81b384838c4015d952ad6111800aa0b50632e16959cc311f3ff25b3860d7600e3cd3a10d4  beautifulsoup4-4.13.4.tar.gz
"
