# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Chris Warrick <aur@chriswarrick.com>

pkgname=python-pygal
epoch=1
pkgver=3.0.4
pkgrel=2
pkgdesc='A Python SVG graph plotting library'
arch=(any)
url='https://www.pygal.org/en/stable/'
license=('LGPL-3.0-or-later')
depends=('python-setuptools' 'python-importlib-metadata')
optdepends=('python-lxml: for XML output through lxml instead of xml.etree'
            'python-cairosvg: for PNG output')
makedepends=('python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest' 'python-lxml' 'python-pyquery' 'python-cairosvg' 'python-flask')
source=("$pkgname-$pkgver.tar.gz::https://github.com/Kozea/pygal/archive/$pkgver.tar.gz")
sha256sums=('b36633ad1ec3566b56b953ef43b0452412cf54c2366efb3586f2b01912d7cdb0')

prepare() {
  sed -ri "s/'pytest-runner'(, )?//" pygal-$pkgver/setup.py
}

build() {
  cd pygal-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd pygal-$pkgver
  pytest pygal/
}

package() {
  cd pygal-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}

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