# Maintainer: Christian Heusel <gromit@archlinux.org>

_name=pytest-run-parallel
pkgname=python-pytest-run-parallel
pkgver=0.7.0
pkgrel=2
pkgdesc="A simple pytest plugin to run tests concurrently"
arch=(any)
url="https://github.com/Quansight-Labs/pytest-run-parallel"
license=(MIT)
depends=(
    python
    python-pytest
)
makedepends=(
    git
    python-build
    python-installer
    python-setuptools
    python-setuptools-scm
    python-wheel
)
optdepends=(
    'python-psutil: for identifying the number of available cores'
)
checkdepends=(
    python-hypothesis
    python-pytest-order
)
source=("git+https://github.com/Quansight-Labs/pytest-run-parallel.git#tag=v${pkgver}")
sha512sums=('6ea933410d9b8cb288ff2d96d09c35cd6e37473ba54acf4eb49d89b5d2d8d7725c05365afe68b2b98e63a7bdb4f1b699602961163ffd30392711a4bb5d512989')
b2sums=('7ab0d214df5f052fb676946fe609ffca9eb89c7d5d85c18eae7eaa1e05903f1f7bbaf0174f983db9b6be0c9b2bfaebc9feb3d35ef8ccaede6b24bb8e8954447c')

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

check() {
    cd $_name
    PYTHONPATH="$PWD/src:$PYTHONPATH" pytest -vv
}

package() {
    cd $_name

    python -m installer --destdir="$pkgdir" dist/*.whl
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
