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

pkgname=python-sentinels
pkgver=1.1.1
pkgrel=1
pkgdesc="Various objects to denote special meanings in python"
url="https://github.com/vmalloc/sentinels"
license=('BSD-3-Clause')
arch=('any')
depends=('python')
makedepends=('git' 'python-build' 'python-installer' 'python-hatchling' 'python-hatch-vcs')
checkdepends=('python-pytest')
source=("git+https://github.com/vmalloc/sentinels.git#tag=$pkgver")
sha512sums=('fa36f3bdc313abc6c7034fca9cfbb105d7fc384d78a53af48c9731ace00e5bff971261e0cce3a59e46a243a66f2b9a0e98a4352b875b3ca5150767f779febc51')

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

check() {
  cd sentinels
  python -m venv --system-site-packages venv
  venv/bin/python -m installer dist/*.whl
  venv/bin/python -m pytest
}

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