summaryrefslogtreecommitdiff
path: root/python-pyinstrument/PKGBUILD
blob: 95c127672ca7d3233226059bc92fda7d27da4328 (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
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: Kaizhao Zhang <zhangkaizhao@gmail.com>

pkgname=python-pyinstrument
_pkg="${pkgname#python-}"
pkgver=4.1.1
pkgrel=4
pkgdesc="Call stack profiler for Python"
arch=('x86_64')
url="https://github.com/joerick/pyinstrument"
license=('BSD')
_pinned_dependencies=(
  'glibc>=2.36'
)
depends=('python>=3.11' 'python<3.12' "${_pinned_dependencies[@]}")
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
# checkdepends=(
# 	'python-pytest'
# 	'python-pytest-asyncio'
# 	'python-flaky'
# 	'python-trio'
# 	'python-django'
# 	'python-sphinx'
# 	'python-myst-parser'
# 	'python-greenlet')
source=("$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/${_pkg::1}/$_pkg/$_pkg-$pkgver.tar.gz")
sha256sums=('1dc2791d2cd2fd3459cb55010004a5cc2a9a8b4625a0cbea45a4b1aebbe2c3a2')

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

# check() {
# 	cd "$_pkg-$pkgver"
# 	local _ver="$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')"
# 	PYTHONPATH="$PWD/build/lib.linux-$CARCH-$_ver" pytest -x
# }

package() {
	cd "$_pkg-$pkgver"
	PYTHONHASHSEED=0 python -m installer --destdir="$pkgdir/" dist/*.whl
	install -Dm644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
	local _site="$(python -c 'import site; print(site.getsitepackages()[0])')"
	install -d "$pkgdir/usr/share/licenses/$pkgname/"
	ln -s "$_site/$_pkg-$pkgver.dist-info/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"
}