# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: George Rawlinson <grawlinson@archlinux.org>

pkgname=python-hatch-requirements-txt
pkgver=0.4.1
pkgrel=2
pkgdesc='Hatchling plugin to read project dependencies from requirements.txt'
arch=('any')
url='https://github.com/repo-helper/hatch-requirements-txt'
license=('MIT')
depends=(
  'python'
  'python-hatchling'
  'python-packaging'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
)
#checkdepends=('')
#optdepends=('')
_commit='2809dc9e2d13a45272d5c74cdf5741d2af30f9a8'
source=("$pkgname::git+$url#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  git describe --tags | sed 's/^v//'
}

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
}
