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

_name=pytest-run-parallel
pkgname=python-pytest-run-parallel
pkgver=0.8.2
pkgrel=1
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
    python-pytest-xdist
)
source=("git+https://github.com/Quansight-Labs/pytest-run-parallel.git#tag=v${pkgver}")
sha512sums=('3d5972aa18553d1abca73e9c4fdd2b307f380cbad8def1e8be3f6ace85dc0ad8d83b2132d2f2540fa316ebea9bb8d08175d0719592e91c648fe31b5b4e7451c1')
b2sums=('d2e07e1bd1e2c25c132717d2c596f9eb8366efbb2f597dff5ff8f049412e81d48206db210ee3c484e61c83c8d2174bafc1a991f21455d2dcb12eb0651858cff0')

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"
}
