# Contributor: Newbyte <newbie13xd@gmail.com>
# Maintainer:
pkgname=py3-mistune
pkgver=3.1.3
pkgrel=0
pkgdesc="Python Markdown parser module"
url="https://github.com/lepture/mistune"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-gpep517 py3-installer py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/lepture/mistune/archive/v$pkgver.tar.gz"
builddir="$srcdir/mistune-$pkgver"

# secfixes:
#   2.0.3-r0:
#     - CVE-2022-34749

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="
0ac4c36d8b0c0f40f5ed4c5ba7873eac69cc9fcddbcf7e279846971fc0df856b3fc03da69a9b39c7c8e7514ac5f631e0c1ee5ce88032bf3c38c4d4d5234544d1  py3-mistune-3.1.3.tar.gz
"
