summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 392ed8d6685b6efc4cb8dc2d79910eb66af0531c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Maintainer: Blair Bonnett <blair dot bonnett at gmail>

pkgname=python-numba-kdtree
pkgdesc="A k-d tree implementation for numba"
pkgver=0.4.0
pkgrel=1
url='https://github.com/mortacious/numba-kdtree'
arch=('x86_64')
license=('MIT')

depends=('python-numba')
makedepends=('python-build' 'python-installer' 'python-setuptools-scm' 'python-wheel')
checkdepends=('python-plyfile' 'python-pytest' 'python-scipy')

_pypi='numba-kdtree'
source=(
  "https://files.pythonhosted.org/packages/source/${_pypi::1}/$_pypi/$_pypi-$pkgver.tar.gz"
)
sha256sums=(
  '449ba313b684e475739e9542efbe48283a02cb1da63f9309239d17791b432c49'
)

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

check() {
  cd "$_pypi-$pkgver"
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer "dist/numba_kdtree-$pkgver"-*.whl

  # Copy the tests into the environment and run from there. Running the tests
  # in their original location fails as pytest modifies the path so the tests
  # try and fail to import an unbuilt version of the library.
  cd test-env
  cp -r ../tests .
  bin/python -m pytest -v tests
}

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