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

_pyname=iniconfig
pkgname=python-iniconfig
pkgver=2.1.0
pkgrel=1
pkgdesc="brain-dead simple config-ini parsing"
url="https://github.com/pytest-dev/iniconfig"
msys2_references=(
  "purl: pkg:pypi/iniconfig"
)
license=('spdx:MIT')
arch=('any')
depends=('python')
makedepends=(
  'python-hatchling'
  'python-hatch-vcs'
  'python-build'
  'python-installer'
)
source=("$_pyname-$pkgver.tar.gz::https://github.com/RonnyPfannschmidt/iniconfig/archive/v$pkgver.tar.gz")
sha256sums=('8bbd2d27f7fc26cb01bf52bc99e7efd56a5a3f4e62c551aed2c9fb0cf4226153')

build() {
  cd "$srcdir/$_pyname-$pkgver"

  export SETUPTOOLS_SCM_PRETEND_VERSION="${pkgver}"
  python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
  cd "$_pyname-$pkgver"

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

