summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e719ac1e6d36590d84beb2e34b0aeac39242628e (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
# Maintainer: thrasibule <guillaume.horel@gmail.com>
# Contributor: Karthik <kndevl@outlook.com>
# Contributor: Sean Enck <enckse@gmail.com>
# Contributor: Kevin Slagle <kjslag at gmail dot com>

pkgname=python-snakeviz
_pythonname=snakeviz
pkgver=2.2.0
pkgrel=1
pkgdesc='A viewer for Python profiling data'
arch=('any')
url="http://jiffyclub.github.io/snakeviz"
license=('BSD')
depends=('python' 'python-tornado')
source=("$_pythonname-$pkgver.tar.gz::https://github.com/jiffyclub/snakeviz/archive/v$pkgver.tar.gz")
makedepends=(python-build python-installer python-setuptools python-wheel)
checkdepends=(ipython python-pytest python-requests)
options=(!emptydirs)
sha256sums=('511a86bbed85e4afc0de3599d62300fcc92138cd8d3aec176bef5b9fa4bfd380')

prepare() {
	cd "$_pythonname-$pkgver"
	cat <<- EOF >> pyproject.toml
	[tool.setuptools]
	packages= ["snakeviz"]
	EOF
}

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

package() {
  cd "$_pythonname-$pkgver/"
  python -m installer --destdir="$pkgdir/" dist/*.whl
  install -D -m 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE.txt"
}

check() {
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  cd "$_pythonname-$pkgver"
  python -m installer --destdir="test_dir" dist/*.whl

  PATH="test_dir/usr/bin:$PATH" PYTHONPATH="test_dir/$site_packages" pytest -v tests
}
# vim:set ts=2 sw=2 et: