# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=pytest-order
pkgname=python-${_pkg}
pkgver=1.4.0
pkgrel=1
pkgdesc="pytest plugin that allows to customize the test execution order"
arch=(any)
url="https://github.com/pytest-dev/pytest-order/"
license=(MIT)
depends=(python-pytest)
makedepends=(python-build
             python-installer
             python-setuptools)
checkdepends=(
    python-pytest-dependency
    python-pytest-mock
    python-pytest-xdist
)
source=(${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('6b612442351703100abc113ba5797e583132b12d92d120b2546f124bbc9c1792')

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

check() {
  cd ${_pkg}-${pkgver}
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python /usr/bin/pytest -vv --color=yes
}

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