# Maintainer: Shohei Maruyama <cheat.sc.linux@outlook.com>

pkgname=python-sphinxcontrib-mermaid
pkgver=2.0.2
pkgrel=1
pkgdesc='Mermaid diagrams in yours sphinx powered docs'
arch=(any)
url='https://github.com/mgaitan/sphinxcontrib-mermaid'
license=(BSD-2-Clause)
depends=(
	python
	python-sphinx
  python-packaging
  python-docutils
  python-pyyaml
  python-jinja
)
makedepends=(
  git
	python-build
	python-installer
  python-hatchling
)
checkdepends=(
	python-pytest
)
source=("$pkgname::git+$url#tag=$pkgver")
sha512sums=('87ef90e9ca86bea5e5adb2ea9b247b29ffde47c23453ceb583cbd71685cced48ccd21e780e5a88785b2b2f857b0dbb78858fa5b72a8a92f9534b1bfc5dd8e4bb')
b2sums=('d95ce30b9c10811e880aad19a8ebbca260c2930c11dfba1221f7240e703ec46bdd2589f458abf8991853046bca5b59e89664ff619e5643152037f1ab4594cc23')

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

check() {
  cd "$pkgname"

  pytest -v --fixtures
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
