# Maintainer:

pkgname=python-hatch-nodejs-version
pkgver=0.4.0
pkgrel=1
pkgdesc='Hatch plugin for versioning from a package.json file'
arch=(any)
url='https://github.com/agoose77/hatch-nodejs-version'
license=(MIT)
depends=(python
         python-hatchling)
makedepends=(python-build
             python-installer)
checkdepends=(python-pytest)
source=(https://github.com/agoose77/hatch-nodejs-version/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('c48b44fb67efa2c1e82f31ac9b5fd1b8213578510d541599a4c55ff4c7f372d5')

build() {
  cd hatch-nodejs-version-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd hatch-nodejs-version-$pkgver
  PYTHONPATH="$PWD"/src \
  pytest -v
}

package() {
  cd hatch-nodejs-version-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
