# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

pkgname=ufmt
pkgver=2.1.0
pkgrel=1
pkgdesc='Safe, atomic formatting with black and µsort'
arch=('any')
url='https://github.com/omnilib/ufmt'
license=('MIT')
depends=('python-black' 'python-click' 'python-libcst' 'python-moreorless'
         'python-tomlkit' 'python-trailrunner' 'python-typing_extensions' 'usort')
makedepends=('python-build' 'python-installer' 'python-flit-core' 'python-wheel')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha512sums=('4165d2aefc3f8e1ff913da858ffae006aa8ad632010accd7ced35f474755ae6061e626ca3cadf9213dd55b603e85ef8a6f9cd9247a5b3a54f06220f5a28516ab')

build() {
  cd $pkgname-$pkgver

  python -m build -nwx
}

check() {
  cd $pkgname-$pkgver

  python -m ufmt.tests
}

package() {
  cd $pkgname-$pkgver

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

  install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

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