# Maintainer: Jelle van der Waa <jelle@archlinux.org>
# Maintainer: Carl Smedstad <carsme@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Mathijs Kadijk <maccain13@gmail.com>

pkgname=python-dnspython
pkgver=2.8.0
pkgrel=1
epoch=1
pkgdesc="A DNS toolkit for Python"
arch=('any')
url="http://www.dnspython.org"
license=('ISC')
depends=('python')
makedepends=(
  'python-build'
  'python-hatchling'
  'python-installer'
  'python-wheel'
)
checkdepends=(
  'python-cryptography'
  'python-idna'
  'python-pytest'
  'python-trio'
)
optdepends=(
  'python-cryptography: DNSSEC support'
  'python-requests-toolbelt: DoH support'
  'python-idna: support for updated IDNA 2008'
  'python-curio: async support'
  'python-trio: async support'
  'python-sniffio: async support'
)
source=("https://github.com/rthalley/dnspython/archive/v$pkgver/dnspython-$pkgver.tar.gz")
sha256sums=('8b21c64bd780d461aa96c5e082db78537c675813b58ef5753056907a602ef2ce')

build() {
  cd ${pkgname#python-}-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd ${pkgname#python-}-$pkgver
  pytest
}

package() {
  cd ${pkgname#python-}-${pkgver}
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}
