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

pkgname=python-trio
pkgver=0.32.0
pkgrel=1
pkgdesc='A friendly Python library for async concurrency and I/O'
arch=(any)
url=https://github.com/python-trio/trio
license=(MIT)
depends=(
  python
  python-attrs
  python-idna
  python-outcome
  python-sniffio
  python-sortedcontainers
  python-typing_extensions
)
makedepends=(
  git
  python-build
  python-setuptools
  python-installer
  python-wheel
)
checkdepends=(
  python-astor
  python-black
  python-isort
  python-jedi
  python-pylint
  python-pytest
  python-ruff
  python-trustme
  python-yaml
)
provides=(python-multio-provider)
_tag=c0b394a55594dc39f353bae87e745083acff172e
source=("git+$url.git#tag=$_tag")
b2sums=('bf96530cab56cc3e1d742be332669f0cc79bcf0b59a63ceef09ea7237df80d1039710c68a7e41c38a53a46c66369c3779be07954bb090b6a00caebe6989bf7b3')

pkgver() {
  cd ${pkgname#python-}
  git describe --tags | sed 's/^v//'
}

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

check() {
  cd ${pkgname#python-}
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest -W=ignore::DeprecationWarning \
    --deselect=src/trio/_tests/tools/test_gen_exports.py::test_run_ruff
}

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

# vim: ts=2 sw=2 et:
