# Maintainer: George Rawlinson <grawlinson@archlinux.org>

pkgname=python-fqdn
pkgver=1.5.1
pkgrel=4
pkgdesc='RFC-compliant FQDN validation and manipulation for Python'
arch=('any')
url='https://github.com/ypcrts/fqdn'
license=('MPL2')
depends=('python')
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-wheel'
  'python-setuptools'
)
checkdepends=('python-pytest')
_commit='3a4feda3414bde7b3386e995ed1d2ed36607d4cf'
source=("$pkgname::git+$url#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  git describe --tags | sed 's/^v//'
}

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

check() {
  cd "$pkgname"

  pytest -v 
}

package() {
  cd "$pkgname"

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

  # documentation
  install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.rst
}
