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

pkgname=python-pytest-trio
pkgver=0.8.0
pkgrel=5
pkgdesc='Pytest plugin for Trio'
arch=(any)
url=https://github.com/python-trio/pytest-trio
license=(
  APACHE
  MIT
)
depends=(
  python
  python-exceptiongroup
  python-hypothesis
  python-outcome
  python-pytest
  python-trio
)
makedepends=(
  git
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(
  python-pytest-cov
  python-trio-asyncio
)
_tag=250ec45f5d72eca78ab0ea2d1571667d2c51f8b5
source=(git+https://github.com/python-trio/pytest-trio.git#tag=${_tag})
b2sums=(SKIP)

prepare() {
  cd pytest-trio
  git cherry-pick -n 9cda20bbb966fe1e4ae51921d566c668654ee5e1
}

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

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

check() {
  cd pytest-trio
  PYTHONPATH="." python -m pytest
}

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

# vim: ts=2 sw=2 et:
