# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Chris Warrick <aur@chriswarrick.com>

pkgname=python-pygal
epoch=1
pkgver=3.0.5
pkgrel=1
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=('git' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest' 'python-lxml' 'python-pyquery' 'python-cairosvg' 'python-flask')
source=("git+https://github.com/Kozea/pygal.git#tag=$pkgver")
sha256sums=('a70beb3172d12b88bdfad25ec43d1bc4d0a0479828711c3037ad92a5b29b0ff0')

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

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

check() {
  cd pygal
  pytest pygal/
}

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

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