# Maintainer: Hu Butui <hot123tea123@gmail.com>

_name=transforms3d
pkgname=python-transforms3d
pkgdesc='3 dimensional spatial transformations for Python'
pkgver=0.4.2
pkgrel=4
url='https://github.com/matthew-brett/transforms3d'
arch=('any')
license=('BSD-3-Clause')
depends=(
  python-numpy
)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-versioneer
  python-wheel
)
checkdepends=(
  python-pytest
  python-scipy
  python-sympy
)
optdepends=(
  'python-sympy: to run the algebraic derivations of some algorithms'
)
source=(
  "${_name}-${pkgver}.tar.gz::https://github.com/matthew-brett/transforms3d/archive/refs/tags/${pkgver}.tar.gz"
)
sha256sums=('d92d8a5a959fbf1e625a58094076b600f4f2909e45b4c0218d3354927d2800e4')

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

check() {
  cd "${_name}-${pkgver}"
  pytest -v
}

package() {
  cd "${_name}-${pkgver}"
  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  rm -rf "${pkgdir}${site_packages}/${_name}/tests"
}
# vim:set ts=2 sw=2 et:
