# 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.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-charset-normalizer
)
makedepends=(
  git
  python-build
  python-installer
  python-wheel
  python-setuptools
  python-setuptools-scm
)
checkdepends=(python-pytest)
source=("$pkgname::git+$url#tag=$pkgver")
sha512sums=('2e3c18c63fea44b3f17155c868d1b8a7e9ea3685385c568c2de3996de29fa06909e884cdd153e6d0b276c9bf1e531e81fc8e7565db23cc4f1f969a329d97c66b')
b2sums=('1d2cbffde080e14243abd91639100506092db16aaab13b98256f9ea6f107ccd51086f7cb79ccdc8c2701604fcc4a60b20b8ed8125e78c17f36a3fcfe1e5d7bab')

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
}
