# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contrinutor: shining <shiningxc@gmail.com>
# Contributor: phillid <dbphillipsnz _at_thingy_that_swirly_a_symbol gmaildott comm>

pkgname=python-pydot
pkgver=3.0.1
pkgrel=3
pkgdesc="Python interface to Graphviz's Dot"
arch=(any)
url="https://github.com/erocarrera/pydot"
license=('MIT')
depends=('python-pyparsing' 'graphviz')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-chardet' 'python-parameterized')
source=("$pkgname-$pkgver.tar.gz::https://github.com/erocarrera/pydot/archive/v$pkgver.tar.gz")
sha512sums=('6aca6e91134e481334c12a7669d3f5df1181f9a4e2ab914a6c8ab87f28d0afa9d97cfc0d9b665d9fdedb3c335624d68967d491f79fc669573aa81cf1401316cd')

build() {
  cd pydot-$pkgver
  python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd pydot-$pkgver/test
  PYTHONPATH="$PWD/../build/lib:$PYTHONPATH" python -m unittest -v
}

package() {
  cd pydot-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSES/MIT.txt
}
