summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4a6ac87a839bde0475daf1766db3bf019933ac7a (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
# Maintainer: Carl Smedstad <carl.smedstad at protonmail dot com>

pkgname=python-pyvis
_name=${pkgname#python-}
pkgver=0.3.2
pkgrel=3
pkgdesc="Python package for creating and visualizing interactive network graphs"
arch=(any)
url="https://github.com/WestHealth/pyvis"
license=(BSD-3-Clause)
depends=(
  ipython
  python
  python-jinja
  python-jsonpickle
  python-networkx
)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(python-pytest)

source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('ff947e224d9825e4b0f3d6710075945c5c8d13bf60aa54e6396c996f34851a3a')

_archive="$_name-$pkgver"

prepare() {
  cd "$_archive"

  sed -i "s/find_packages()/find_packages(exclude=['pyvis.tests', 'pyvis.tests.*'])/" setup.py
}

build() {
  cd "$_archive"

  python -m build --wheel --no-isolation
}

check() {
  cd "$_archive"

  pytest \
    --ignore pyvis/tests/test_html.py # Requires google-chrome & selenium
}

package() {
  cd "$_archive"

  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE_BSD.txt
}