# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Pieter Goetschalckx <3.14.e.ter at gmail dot com>
# Contributor: Stijn Seghers (Procrat) <stijnseghers at gmail dot com>

pkgname=pylama
pkgver=8.3.7
pkgrel=1
pkgdesc="Code audit tool for python"
arch=('any')
url="https://github.com/klen/pylama"
license=('GPL3')
depends=('python-pycodestyle' 'python-pydocstyle' 'python-pyflakes' 'python-mccabe')
checkdepends=('python-pytest' 'git' 'mypy' 'python-tomli')
optdepends=('python-radon: radon support')
source=("$pkgname-$pkgver.tar.gz::https://github.com/klen/pylama/archive/$pkgver.tar.gz")
sha256sums=('72e4e849e5e9466a326f61b5f94f8bc931e593dc0b3b4920be74976cd3b2c790')

build() {
  cd $pkgname-$pkgver
  python setup.py build
}

check() {
  cd $pkgname-$pkgver
  python setup.py install --root="$PWD/tmp_install" --optimize=1
  PYTHONPATH="$PWD/tmp_install/usr/lib/python3.10/site-packages:$PYTHONPATH:$PWD/tests" py.test --pylama pylama
  PYTHONPATH="$PWD/tmp_install/usr/lib/python3.10/site-packages:$PYTHONPATH:$PWD/tests" py.test tests --deselect tests/test_config.py::test_ignore_select \
                                                                                                     --deselect tests/test_linters.py::test_eradicate
}

package() {
  cd $pkgname-$pkgver
  python setup.py install --root="$pkgdir/" --optimize=1
}
