# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=python-tomli-w
pkgver=1.2.0
pkgrel=1
pkgdesc="A lil' TOML writer"
url=https://github.com/hukkin/tomli-w
license=(MIT)
arch=(any)
depends=(python)
makedepends=(
  git
  python-build
  python-flit-core
  python-installer
)
checkdepends=(
  python-pytest
  python-tomli
)
_tag=a8f80172ba16fe694e37f6e07e6352ecee384c58
source=(git+https://github.com/hukkin/tomli-w.git#tag=${_tag})
b2sums=('35efac07d67e55eec96447167d5788eadf968f00b130123d2a31c8f0964d57e7b8edbd4b5c848d7eef95d177457f6037b93f40c27d5c9da6c9ebaf354fece4e5')

pkgver() {
  cd tomli-w
  git describe --tags
}

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

check() {
  cd tomli-w
  PYTHONPATH="src:$PYTHONPATH" python -m pytest
}

package() {
  python -m installer --destdir="${pkgdir}" tomli-w/dist/*.whl
  install -Dm 644 tomli-w/LICENSE -t "${pkgdir}"/usr/share/licenses/python-tomli-w/
}

# vim: ts=2 sw=2 et:
