blob: 71aeeff2156d421a8a0dbf1edf3f0b5957ae99aa (
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
|
# Contributor: Felix Yan <felixonmars@archlinux.org>
_name=memory_profiler
pkgname=python-memory-profiler
pkgver=0.61
pkgrel=4
pkgdesc="A module for monitoring memory usage of a python program"
url="https://github.com/pythonprofilers/memory_profiler"
license=('BSD')
arch=('any')
depends=('python-psutil')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-numpy')
optdepends=('python-numpy: for mprof')
source=("https://github.com/pythonprofilers/memory_profiler/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
"https://github.com/pythonprofilers/memory_profiler/commit/940aa76f5da8b7cba5938f17990da054e013de0a.patch"
"remove-test_async.py.patch"
"remove-test_exception.py.patch")
b2sums=('418ae6e7433dd58b00c8706209a7172c31ccf57d74255aa670b271bc9d76b339bd582b48886bed7b53062abd8eb421678c911b3495de4d541b949f340aad7091'
'8d8e71a5ccde70a61102f4cebc15db33b88dbbd22c351fdc6595519c6aa169e1436331b119cebe41dda6b020ff963a343c62420b7215f262c0caa68d8df89f6a'
'9925807075d96a8f709cf8a4a55fea7d2e4a822a29210f5680c32e8e30db0c6e4dad7d79f7ece8bb22edad0d587823ae37ee06dde4710e0375ebaf013336f221'
'f7c41f1edbe207588b8c926182ebacd2e08b9a63b7891a2e2b1662f72fc0bd35a6993574442f697c097e09b48ef3149f626e9e8c2e02d9a6acc0806699555332')
prepare() {
cd $_name-$pkgver
patch -p1 -i ../940aa76f5da8b7cba5938f17990da054e013de0a.patch
patch -p1 -i ../remove-test_async.py.patch
patch -p1 -i ../remove-test_exception.py.patch
}
build() {
cd $_name-$pkgver
python -m build --wheel --no-isolation
}
check() {
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
cd $_name-$pkgver
# install to temporary location, as importlib is used
python -m installer --destdir=test_dir dist/*.whl
export PYTHONPATH="test_dir/$site_packages:$PYTHONPATH"
export PATH="$PWD/test_dir/usr/bin:$PATH"
make test
}
package() {
cd $_name-$pkgver
python -m installer --destdir="$pkgdir" dist/*.whl
install -vDm644 COPYING -t "$pkgdir"/usr/share/licenses/$pkgname/
}
|