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

pkgname=python-pytest-codspeed
pkgver=3.2.0
pkgrel=1
pkgdesc='Pytest plugin to create CodSpeed benchmarks'
arch=(any)
url=https://github.com/CodSpeedHQ/pytest-codspeed
license=(MIT)
depends=(
  python
  python-cffi
  python-pytest
  python-rich
)
makedepends=(
  git
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(python-pytest-cov)
_tag=253b1bea24e909d257c7650265ff34e22af6a3bc
source=(git+https://github.com/CodSpeedHQ/pytest-codspeed.git#tag=${_tag})
b2sums=('3802390c89f297de64205ea0317d984c8afeb856cc7123f94c90a9ef284fde40de8c4263617b70babbe028e114f011945aa52743f8cacfa061b4ffda395ab1f1')

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

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

check() {
  cd pytest-codspeed
  PYTHONPATH="src:$PYTHONPATH" python -m pytest
}

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

# vim: ts=2 sw=2 et:
