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

pkgname=python-iniconfig
pkgver=2.1.0
pkgrel=1
pkgdesc="brain-dead simple config-ini parsing"
url="https://github.com/RonnyPfannschmidt/iniconfig"
license=('MIT')
arch=('any')
depends=('python')
makedepends=('git' 'python-build' 'python-installer' 'python-hatchling' 'python-hatch-vcs')
checkdepends=('python-pytest')
source=("git+https://github.com/RonnyPfannschmidt/iniconfig.git#tag=v$pkgver")
sha512sums=('6680292c0883c39f02ff99c0c79b247bf7a7b61b43b9720da52ef3b94ff9404f95c86a4537e273cc716cb2bd165937f978d8eef92de447eb94f973f39f8d59ff')

build() {
  cd iniconfig
  python -m build -nw
}

check() {
  cd iniconfig
  PYTHONPATH="$PWD/src" pytest
}

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