# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: Hao Long <imlonghao@archlinuxcn.org>

pkgname=python-rich
pkgver=14.3.3
pkgrel=1
pkgdesc='Python library for rich text and beautiful formatting in the terminal'
arch=(any)
url='https://github.com/Textualize/rich'
license=(MIT)
depends=(python python-{markdown-it-py,pygments})
makedepends=(git python-{build,installer,poetry-core,wheel})
source=("$pkgname::git+https://github.com/Textualize/rich#tag=v$pkgver")
sha512sums=('6dd67826939193382d1a8307f57ff0a851143e3c9361e13ddbc8a5deeeeffa60da4888e5102bd5effc918cc90784c50f816746fa760f0fd5e8ce397acc5e558a')
b2sums=('b9362233761a7c7cae549c9dde13bcd604a6d79a3092e30eab76a3799e469e599d913015179a4f25be4a6e9f4e1d475ad7a3e37310e3b541658d86ec64bf283b')

build() {
  cd "$pkgname"

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

package() {
  cd "$pkgname"

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

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