# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: Ismael Carnales <icarnales at gmail dot com>
# Contributor: Sergey Mastykov <smastykov[at]gmail[dot]com>

pkgname=autopep8
pkgver=2.3.1
pkgrel=1
epoch=1
pkgdesc='A tool that automatically formats Python code to conform to the PEP 8 style guide'
arch=(any)
url='https://github.com/hhatto/autopep8'
license=('MIT')
depends=(
  'python'
  'python-pycodestyle'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-wheel'
  'python-setuptools'
)
checkdepends=('python-pytest')
source=("$pkgname::git+$url#tag=v$pkgver")
sha512sums=('e609dfcaeb38b2510caecf9ab8fe618dc0998518ee6cc74840ee82e503823bc79e0ae549a9f2f81af36524f52fde22bd02f4d6bf7c7f70e4a0873a26fb3de0e1')
b2sums=('d4f7e2b5ec0ccdc64830c67208ff1c7d13f68218fa14508574acd164c2b0ebcb3e88ebe23388e31cfe884986188e6f99797227ef91fabc4ffcb53bbb14cccb6d')

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

check() {
  cd "$pkgname"

  pytest -v -k 'not test_e204'
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}

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