diff options
author | David Runge | 2023-01-13 23:29:28 +0000 |
---|---|---|
committer | David Runge | 2023-01-13 23:29:28 +0000 |
commit | 269b2bc23c13be00afff81beb1d2203718848dec (patch) | |
tree | c32aeee95c0fab93d8b60bf42facc778e955d133 | |
parent | ec20566b3c32260783f459bebb07a43f148a10e8 (diff) | |
download | aur-269b2bc23c13be00afff81beb1d2203718848dec.tar.gz |
Rebuild to fix hardcoding of python version and other issues.
Remove hardcoding of python version.
Switch to PEP517.
Add optdepends on python-numpy.
-rw-r--r-- | PKGBUILD | 29 |
1 files changed, 18 insertions, 11 deletions
@@ -1,32 +1,39 @@ # Maintainer: Felix Yan <felixonmars@archlinux.org> +_name=memory_profiler pkgname=python-memory-profiler pkgver=0.61 -pkgrel=1 +pkgrel=2 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-setuptools') +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") sha512sums=('02c70a049107ad4df635e20e22eaaa91fd4e4fd29690b0a7c314e08ed6e076bbb81f85dd97924ed35f7f0133cfd3c7e55b35400449489733beb172debe592c4e') +b2sums=('418ae6e7433dd58b00c8706209a7172c31ccf57d74255aa670b271bc9d76b339bd582b48886bed7b53062abd8eb421678c911b3495de4d541b949f340aad7091') build() { - cd memory_profiler-$pkgver - python setup.py build + cd $_name-$pkgver + python -m build --wheel --no-isolation } check() { - cd memory_profiler-$pkgver - # Hack entry points by installing it - python setup.py install --root="$PWD/tmp_install" --optimize=1 - PYTHONPATH="$PWD/tmp_install/usr/lib/python3.10/site-packages:$PYTHONPATH" PATH="$PWD/tmp_install/usr/bin:$PATH" make test + 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 memory_profiler-$pkgver - python setup.py install --root="$pkgdir" --optimize=1 - install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING + cd $_name-$pkgver + python -m installer --destdir="$pkgdir" dist/*.whl + install -vDm644 COPYING -t "$pkgdir"/usr/share/licenses/$pkgname/ } |