# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=python-sniffio
pkgver=1.3.1
pkgrel=4
pkgdesc='Sniff out which async library your code is running under'
arch=(any)
url=https://github.com/python-trio/sniffio
license=(MIT)
depends=(python)
makedepends=(
  git
  python-build
  python-installer
  python-setuptools
  python-setuptools-scm
  python-wheel
)
checkdepends=(
  python-curio
  python-pytest
)
_tag=ae020e13b98d276a6558ffc25e82509fd4c288f0
source=(git+https://github.com/python-trio/sniffio.git#tag=${_tag})
sha256sums=(SKIP)

pkgver() {
  cd sniffio
  git describe --tags | sed 's/^v//'
}

build() {
  cd sniffio
  python -m build --wheel --no-isolation
}

check() {
  cd sniffio
  pytest
}

package() {
  python -m installer --destdir="${pkgdir}" sniffio/dist/*.whl
  install -Dm 644 sniffio/LICENSE -t "${pkgdir}"/usr/share/licenses/python-sniffio/
}

# vim: ts=2 sw=2 et:
