blob: da44a4565c3496181a41f21d039ca5611cb39ba8 (
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
46
47
48
49
50
|
# Maintainer: Blair Bonnett <blair dot bonnett at gmail dot com>
pkgname=python-miepython
pkgdesc='Mie scattering of light off perfect spheres'
pkgver=2.2.2
pkgrel=1
arch=('any')
url='https://miepython.readthedocs.io/'
license=('MIT')
depends=('python-matplotlib' 'python-numba' 'python-numpy')
optdepends=(
'python-scipy: to run the included examples'
)
checkdepends=('jupyter-nbconvert' 'jupyter-nbformat' 'python-pytest' 'python-scipy')
makedepends=('python-setuptools')
_pyname=miepython
source=(
"$_pyname-$pkgver.tar.gz::https://github.com/scottprahl/$_pyname/archive/v$pkgver.tar.gz"
)
sha256sums=(
'3ac8dd0fe67c97dfb07e6237d771d67fa48f354793838ef8a22da5618aa19bf8'
)
build() {
cd "$_pyname-$pkgver"
python setup.py build
}
check() {
cd "$_pyname-$pkgver"
# We need an absolute path here. The notebook tests are run in a different
# directory so a relative path causes test failures.
PYTHONPATH="$PWD/build/lib" pytest -v --notebooks
# Get rid of cached bytecode and Numba outputs.
rm -rf build/lib/miepython/__pycache__
}
package() {
cd "$_pyname-$pkgver"
python setup.py install --skip-build --optimize=1 --root="$pkgdir" --prefix=/usr
install -Dm644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname"
install -m755 -d "$pkgdir/usr/share/$pkgname/examples"
install -m755 -d "$pkgdir/usr/share/$pkgname/examples/notebooks"
install -m644 -t "$pkgdir/usr/share/$pkgname/examples" miepython/examples/*.py
install -m644 -t "$pkgdir/usr/share/$pkgname/examples/notebooks" docs/*.ipynb
}
|