# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-rich-argparse
pkgver=1.8.0
pkgrel=1
pkgdesc='Rich help formatters for argparse and optparse'
arch=('any')
url='https://github.com/hamdanal/rich-argparse'
license=('MIT')
depends=('python' 'python-rich')
makedepends=('git' 'python-build' 'python-hatchling' 'python-installer')
checkdepends=('python-pytest')
source=("git+https://github.com/hamdanal/rich-argparse.git#tag=v$pkgver")
sha512sums=('e8388e892148a71285d181c52230d18c163166e98c24cc38856f081138e5ad5181cb769bea5dc7712339e5b482789c99018ef21f5fc5ecbb9f942203324c52b3')

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

check() {
  cd rich-argparse
  pytest
}

package() {
  cd rich-argparse
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}
