# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-myst-parser
pkgver=4.0.0
pkgrel=0
pkgdesc="Extended commonmark compliant parser"
url="https://myst-parser.readthedocs.io/"
arch="noarch"
license="MIT"
depends="
	py3-docutils
	py3-jinja2
	py3-markdown-it-py
	py3-mdit-py-plugins
	py3-sphinx
	py3-typing-extensions
	py3-yaml
	"
makedepends="py3-gpep517 py3-flit-core py3-installer"
checkdepends="py3-pytest py3-pytest-benchmark py3-beautifulsoup4"
subpackages="$pkgname-pyc"
source="https://github.com/executablebooks/MyST-Parser/archive/v$pkgver/py3-myst-parser-$pkgver.tar.gz"
builddir="$srcdir/MyST-Parser-$pkgver"
options="!check" # TODO

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="
82a8c642d839133413577fd85b5668a6b4d3869f60b7c7c64f98ec6cf52f33b28abd33ee7ddbbf8e286a3f233a152878802e6a8091c88f63844ac774c88ebd62  py3-myst-parser-4.0.0.tar.gz
"
