# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Maintainer: Daniel M. Capella <polyzen@archlinux.org>

_pkgname=markdown-it-py
pkgname=python-$_pkgname
pkgver=3.0.0
pkgrel=1
pkgdesc='Python port of markdown-it. Markdown parsing, done right!'
arch=('any')
url='https://github.com/executablebooks/markdown-it-py'
license=('MIT')
depends=('python-mdurl')
optdepends=('python-mdit_py_plugins: core plugins')
makedepends=('python-build' 'python-flit-core' 'python-installer')
checkdepends=('python-pytest' 'python-pytest-regressions' 'python-mdit_py_plugins' 'python-linkify-it-py')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha512sums=('820265595ab650f5ac64419d5c2687d1ee361d2a0550b9d94e86ec826cfe5e89cbd69e59d6582aac41d3b95f00ce4a0b7213bf6cd590fdbd8fd9b743c7418759')

build() {
  cd $_pkgname-$pkgver

  python -m build
}

check() {
  cd $_pkgname-$pkgver

  python -m pytest tests
}

package() {
  cd $_pkgname-$pkgver

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

  install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

# vim:set ts=2 sw=2 et:
