summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6a8af22c3268fdfb0696b7d52fa8821601a17944 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Maintainer: sasvari <sasvari@fastmail.com>
# Maintainer: Torleif Skår <torleif.skaar AT gmail DOT com>
#             adapted from package python2-scikit-rf
_name="scikit-rf"
pkgname="python-${_name}"
pkgver=2.2.0
pkgrel=1
pkgdesc="Scikit-rf (aka skrf) is a python package for RF/Microwave engineering"
arch=(any)
url="https://github.com/scikit-rf/scikit-rf"
license=("BSD-3-Clause")
depends=(
    "python"
    "python-numpy"
    "python-scipy"
    "python-pandas"
    "python-typing_extensions"
    # matplotlib and networkx aren't strictly necessary,
    # but they are in use _quite_ often
    "python-matplotlib"
    "python-networkx"
)
makedepends=(
    "git"
    "python-build"
    "python-installer"
    "python-setuptools"
    "python-wheel"
)
optdepends=(
    "python-openpyxl: for Excel read/write support"
    "python-pyvisa: for VISA (instrument control) support"
    "python-pyvisa-py: for VISA support, alternative backend"
    "python-bokeh: for running examples in the notebook"
)
checkdepends=(
  "python-pytest"
)

b2sums=('4a89b83a59c2d0a69c52f581f3855bbd9996bc96fd3a030b422e559d94f293226333c10c214328047abd56e5d18fcd437b13ef037f576b207bf66a739175a85f')
source=("${pkgname}::git+${url}#tag=v${pkgver}")

prepare() {
    cd "${pkgname}"

    # We don't need coverage test; disable it
    sed -E -i '/^addopts/ s/--cov=skrf\s*//g' pyproject.toml
}

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

check() {
    cd "${pkgname}"

    # Install the package in a virtual environment and run the tests
    python -m venv --system-site-packages test-env
    test-env/bin/python -m installer dist/*.whl
    test-env/bin/python -P -m pytest
}

package() {
    cd "${pkgname}"
    python -m installer --destdir="$pkgdir" dist/*.whl

    # BSD-3-Clause license needs to be installed
    install -Dm0644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

# vim: set ts=4 sw=4 et: