# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Andrzej Giniewicz <gginiu@gmail.com>
# Contributor: Michael Schubert <mschu.dev at gmail>
# Contributor: Panagiotis Mavrogiorgos (pmav99) <> (gmail)

pkgname=python-bottleneck
pkgver=1.6.0
pkgrel=2
pkgdesc="Fast NumPy array functions written in Cython"
arch=(x86_64 aarch64)
url="https://github.com/kwgoodman/bottleneck"
license=(BSD-2-Clause)
depends=(glibc python python-numpy)
makedepends=(python-setuptools python-build python-installer python-wheel python-versioneer)
checkdepends=(python-pytest)
source=($pkgname-$pkgver.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz)
sha256sums=('f3ebfd2342f25e04dab7fac3db4190595fa9c47a2357eff6e18ce2e74a0dcc97')

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

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

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