# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=py3-markdown
pkgver=3.7
pkgrel=0
pkgdesc="Python3 implementation of Markdown"
url="https://python-markdown.github.io/"
arch="noarch"
license="BSD-3-Clause"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-coverage py3-yaml"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Python-Markdown/markdown/archive/refs/tags/$pkgver.tar.gz
	use-correct-import-path-in-abbr-py.patch
	"
builddir="$srcdir/markdown-$pkgver"

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

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 unittest discover tests
}

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

sha512sums="
f4777f32e8203cc8e41a5aaf7c6afa41e4354e065315e4b926e1ebb44e28db293f6b5f43cd546485b5249aebe01d73e8c1e16bcc9ce0c38aebe73e0a590d4df6  py3-markdown-3.7.tar.gz
fd45c2c210b9b9bdf1e751bacb25a48046319e359d341d69dd6ab85538f53362b08df0aef1726aa9557cb55a111efe7a06788d15bed9d516d567da6d709fe991  use-correct-import-path-in-abbr-py.patch
"
