[arch-commits] Commit in python-psutil/trunk (2 files)

Jelle van der Waa jelle at archlinux.org
Sun Nov 18 19:28:35 UTC 2018


    Date: Sunday, November 18, 2018 @ 19:28:34
  Author: jelle
Revision: 408733

upgpkg: python-psutil 5.4.8-1

Added:
  python-psutil/trunk/fix_test_disk_io_counters_sysfs.patch
Modified:
  python-psutil/trunk/PKGBUILD

---------------------------------------+
 PKGBUILD                              |   33 ++++++++++++++++++--------------
 fix_test_disk_io_counters_sysfs.patch |   20 +++++++++++++++++++
 2 files changed, 39 insertions(+), 14 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-11-18 19:03:45 UTC (rev 408732)
+++ PKGBUILD	2018-11-18 19:28:34 UTC (rev 408733)
@@ -2,23 +2,31 @@
 
 pkgbase=python-psutil
 pkgname=('python-psutil' 'python2-psutil')
-pkgver=5.4.7
+pkgver=5.4.8
 pkgrel=1
 arch=('x86_64')
 url='https://github.com/giampaolo/psutil'
 license=('custom: BSD')
 makedepends=('python' 'python-setuptools' 'python2' 'python2-setuptools')
-checkdepends=('net-tools' 'procps-ng' 'python2-nose' 'python-nose')
-source=("https://github.com/giampaolo/psutil/archive/release-$pkgver.tar.gz")
-md5sums=('e8d6259eafe5925e7c522868aedd2caa')
+checkdepends=('net-tools' 'procps-ng' 'python2-ipaddress' 'python2-mock' 'python-mock' 'python-pytest')
+source=("https://github.com/giampaolo/psutil/archive/release-$pkgver.tar.gz"
+        "fix_disk_io_counters.patch::https://github.com/giampaolo/psutil/commit/8f99f3782663959062ee868bbfdbc336307a3a4d.patch"
+        "fix_test_disk_io_counters_sysfs.patch")
+sha512sums=('66990d006680142c309874624882ba7612cdef99f44cfed07ba5371ba20e1c978e42364248dba09fce053d78a62630061d1995662f9b965492ea2261eda83ea8'
+            '5b6318f0a74360c048ef910109c9ed2738ad9755d2a3061d341f3c3cb7256d1eedbac2a452d453415e4155720ca51a9abb471a638583d30b7d648483af21b890'
+            'f2164b0c31a2f0cc9db0913451ded71c8fc401ac88ebb5cabc00b2902e37c2695b273c75799ca2a060c11555e5b05a2f6aac4c214ec7e000c7b79d90a2e7e07e')
 
+prepare() {
+  cd psutil-release-$pkgver
+  patch -Np1 -i $srcdir/fix_disk_io_counters.patch
+  patch -Np1 -i $srcdir/fix_test_disk_io_counters_sysfs.patch
+}
+
 build() {
   cd psutil-release-$pkgver
 
-  msg python
   python setup.py build --build-lib=build/python
 
-  msg python2
   python2 setup.py build --build-lib=build/python2
   find build/python2 -type f -exec \
     sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python2,' {} \;
@@ -27,15 +35,12 @@
 check() {
   cd psutil-release-$pkgver
 
-  msg python
-  export PYTHONPATH="$PWD/build/python"
-  cd psutil/tests/
-  # FIXME: dynamic loading so
+  # Required for testing
+  cp setup.py build/python
+  cp -r scripts build/python/
 
-
-  msg python2
-  export PYTHONPATH="$PWD/build/python2"
-  #python2 psutil/tests/runner.py
+# 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_python-psutil() {

Added: fix_test_disk_io_counters_sysfs.patch
===================================================================
--- fix_test_disk_io_counters_sysfs.patch	                        (rev 0)
+++ fix_test_disk_io_counters_sysfs.patch	2018-11-18 19:28:34 UTC (rev 408733)
@@ -0,0 +1,20 @@
+diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py
+index b775d39a..dcacfea0 100644
+--- a/psutil/_pslinux.py
++++ b/psutil/_pslinux.py
+@@ -1099,8 +1099,13 @@ def disk_io_counters(perdisk=False):
+                 with open_text(os.path.join(root, 'stat')) as f:
+                     fields = f.read().strip().split()
+                 name = os.path.basename(root)
+-                (reads, reads_merged, rbytes, rtime, writes, writes_merged,
+-                    wbytes, wtime, _, busy_time, _) = map(int, fields)
++                if len(fields) == 11:
++                    (reads, reads_merged, rbytes, rtime, writes, writes_merged,
++                     wbytes, wtime, _, busy_time, _) = map(int, fields)
++                else:
++                    (reads, reads_merged, rbytes, rtime, writes, writes_merged,
++                     wbytes, wtime, _, busy_time, _, _, _, _, _) = map(int,
++                                                                       fields)
+                 yield (name, reads, writes, rbytes, wbytes, rtime,
+                        wtime, reads_merged, writes_merged, busy_time)
+ 



More information about the arch-commits mailing list