# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pytest-xdist
pkgver=3.5.0
pkgrel=2
pkgdesc='py.test xdist plugin for distributed testing and loop-on-failing modes'
arch=('any')
license=('MIT')
url='https://github.com/pytest-dev/pytest-xdist'
depends=('python-execnet' 'python-pytest')
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools-scm' 'python-wheel')
checkdepends=('python-filelock' 'python-psutil')
source=("git+https://github.com/pytest-dev/pytest-xdist.git#tag=v$pkgver")
sha512sums=('33aace625d501a3f005188a2baa2dcbb4106b93d404bff85787fd6520b72840eb3a35c0abe7f641408b543815850040c7f74241cb6da43661351368460610dc7')

build() {
  cd pytest-xdist
  python -m build -nw
}

check() {
  # Hack entry points by installing it

  cd pytest-xdist
  python -m installer -d "$PWD/tmp_install" dist/*.whl
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  PYTHONPATH="$PWD/tmp_install$site_packages:$PYTHONPATH" pytest
}

package() {
  cd pytest-xdist
  python -m installer -d "$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

# vim:set ts=2 sw=2 et:
