# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>

pkgname=python-bowler
_name="${pkgname#python-}"
pkgver=0.9.0
pkgrel=9
pkgdesc="Safe code refactoring for modern Python."
arch=(any)
url="https://github.com/facebookincubator/bowler"
license=(MIT)
depends=(
  ipython
  python
  python-attrs
  python-click
  python-fissix
  python-moreorless
  python-volatile
)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-wheel
)
source=($pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz)
sha256sums=('554d6ba24212a642dd9baefe8b0e6ce63332aaf1c7c6b483e87c08aa19cd72c1')
b2sums=('09f69a5047bd450aef1c8f39d60172ef2eb16b10bb96da269a0cb74ec6889c0033c1c616e3f6aab41b4442a8becf44009543c271cefd9cf2595afffd46c73cb5')

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

check() {
  cd ${_name^}-$pkgver
  python -m $_name.tests
}

package() {
  cd ${_name^}-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}
