# 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.1.0
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=debian/$pkgver")
sha512sums=('733a901017cb000a92b1fd0944a96d1f0f04e0a1b1d349fc25f72fe177ebf6be97f7636531e94b095854bcc6783e858777263cecf0bc31ebfc86262c4fb0f93b')
b2sums=('10ff7a658b1386c80785773ba8d41efac3cfb866319637277992da1203835a513a8078f4cd6528f696af3cc0c7be8df21c6bde6fd83aa651d8e469c674c3dde4')

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
}
