# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=python-psutil
pkgver=5.9.8
pkgrel=4
arch=('x86_64')
pkgdesc='A cross-platform process and system utilities module for Python'
url='https://github.com/giampaolo/psutil'
license=('BSD-3-Clause')
depends=('python')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('net-tools' 'procps-ng' 'python-pytest')
source=("https://github.com/giampaolo/psutil/archive/release-$pkgver.tar.gz")
sha512sums=('9943adcf4cdb333c729765fef9e3cc7623ef90cfdf8c91fcb8093c45a6978efa9f749b1f1818dde99a772b89e9dd86c3d7cc5f8f1047bf8782d00a30d9284c7f')

build() {
  cd psutil-release-$pkgver

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

check() {
  cd psutil-release-$pkgver

  # Required for testing
#cp setup.py build/python
#cp -r scripts build/python/

# 4 non-working tests in build chroot, requires fixes. Test framework does not allow exclusion.
#  PYTHONPATH="$PWD/build/python" python psutil/tests/__main__.py
}

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

# vim:set ts=2 sw=2 et:
