# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>

_pyname=hatch-vcs
pkgname=python-hatch-vcs
pkgver=0.4.0
pkgrel=1
pkgdesc="Hatch plugin for versioning with your preferred VCS"
url="https://github.com/ofek/hatch-vcs"
license=('spdx:MIT')
arch=('any')
depends=(
  'python-hatchling'
  'python-setuptools-scm'
)
makedepends=(
  'python-build'
  'python-installer'
)
source=("https://pypi.org/packages/source/${_pyname::1}/${_pyname}/${_pyname/-/_}-${pkgver}.tar.gz")
sha256sums=('093810748fe01db0d451fabcf2c1ac2688caefd232d4ede967090b1c1b07d9f7')

build() {
  cd "${_pyname/-/_}-${pkgver}"

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

package() {
  cd "${_pyname/-/_}-${pkgver}"

  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname/"
}

