# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Kyle Keen <keenerd@gmail.com>
# Contributor: Angel Velasquez <angvp@archlinux.org>
# Contributor: Andrew Antle <andrew dot antle at gmail dot com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Chaiwat Suttipongsakul <cwt at bashell dot com>
pkgname=python-markdown
pkgver=3.6
pkgrel=3
pkgdesc="Python implementation of John Gruber's Markdown"
arch=('any')
url='https://python-markdown.github.io/'
license=('BSD')
depends=('python')
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools' 'python-wheel')
optdepends=('python-yaml: parse Python in YAML metadata')
#checkdepends=('python-yaml')
source=("$pkgname::git+https://github.com/Python-Markdown/markdown#tag=$pkgver")
sha256sums=('17665ec53a4eed996420f13196d7510c34be95853837d834960f632a86478b73')
build() {
cd "$pkgname"
python -m build --wheel --no-isolation
}
#check() {
# cd "$pkgname"
# [[ $(python -c "import markdown; print(markdown.__version__)") == "$pkgver" ]]
# [[ $(python -c "import markdown; print(markdown.markdown('*test*'))") == "<p><em>test</em></p>" ]]
# python -m unittest discover tests
#}
package() {
cd "$pkgname"
python -m installer --destdir="$pkgdir" dist/*.whl
# symlink license file
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
install -d "$pkgdir/usr/share/licenses/$pkgname"
ln -s "$site_packages/Markdown-$pkgver.dist-info/LICENSE.md" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
}