# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Justin Vreeland <vreeland.justin@gmail.com>
# Contributor: Mike Javorski (javmorin) <mike.javorski gmail com>
# Contributor: Johannes Dewender   arch at JonnyJD dot net

pkgname=python-debian
pkgver=1.0.1
pkgrel=1
pkgdesc='Python module to work with Debian-related data formats'
arch=(any)
url='https://salsa.debian.org/python-debian-team/python-debian'
license=(GPL-2.0-or-later)
depends=(
  python
  python-chardet
)
makedepends=(
  git
  python-build
  python-installer
  python-wheel
  python-setuptools
  python-setuptools-scm
)
checkdepends=(python-pytest)
source=("$pkgname::git+$url#tag=$pkgver")
sha512sums=('012f2ffca71ac79140f309fd2a723e6c68d3c01ac4228ab14258c0d4eeadf36699899f91c5e71f397851e4dd4dae78b1549c8ec1823f396ceeed70caebd0c50c')
b2sums=('2b9ed525aed0d67ce6028529d5823b584c2d39def09f1bed43fef2b457a6a3b74867d0874273616869f0492b1edad45ec266cec47ee66d98a00204d5c88db4b9')

build() {
  cd "$pkgname"

SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver python -m build --wheel --no-isolation
}

check() {
  cd "$pkgname"

  pytest -v
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl
}
