dev-python/psutil: Bump to 5.7.0
authorMichał Górny <mgorny@gentoo.org>
Wed, 19 Feb 2020 06:37:42 +0000 (07:37 +0100)
committerMichał Górny <mgorny@gentoo.org>
Wed, 19 Feb 2020 06:37:42 +0000 (07:37 +0100)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
dev-python/psutil/Manifest
dev-python/psutil/files/psutil-5.7.0-tests.patch [new file with mode: 0644]
dev-python/psutil/psutil-5.7.0.ebuild [new file with mode: 0644]

index b4f19d028a857d3589d5945e59178d228e8d2db8..bbf5dadec5ec4a1a33fe71683d9c71c7f8223455 100644 (file)
@@ -3,3 +3,4 @@ DIST psutil-5.5.0.tar.gz 425058 BLAKE2B 0a13149b060d1a99faa600470fdbd592ee520b24
 DIST psutil-5.6.0.tar.gz 426596 BLAKE2B 803cb09262575a7193ecc9cf9bfbbf721e10ef4adc25672f6747111306d1803c1422c9894636421653eaae11c241100f58837c80173ab473bb9dc39da2580aed SHA512 01daf80698954a53a9e987afad6c7aefad502c76b5f34601728c3864c924ca52099f139242e508fd4c72378cbe436c9870eca7a33c112fb8dead0be501aaf2aa
 DIST psutil-5.6.5.tar.gz 447489 BLAKE2B 9301d1580bded927b4b117facf82a3c6be9b43cb648f0f52b841dc2c59cbcc58b5a5c3e0ea7cee30a546e1ea1c00fc0e03b3b49fa69209bbfd3c873e18510859 SHA512 037b1501b686b7101be4180c8698b09d20d4260962a88f0c437ff558d91c405f56eae186c9d55c1893c612c4534093ab26e6943f0ed56db69e343c5c0317be1b
 DIST psutil-5.6.7.tar.gz 448321 BLAKE2B 4e47fb7def5a0eed162686d4e90dd122bd380eca50c3294cd89ed154e27f71972dbc2b3b481456d5022107a1adad2a637e8f233002d429463232c38a04a957c7 SHA512 74eb488b91764941e38214f07bca00e3c837167ad543bfd9ae3b83d665e2be1bb5341eca4aff9282ad50d321568a679e1ffa2ee72ad7b4965cda92b7c80b2503
+DIST psutil-5.7.0.tar.gz 449628 BLAKE2B 3bd07a0a2f95a539910fa1cef92e72d168c3ee7a495c0defd3fad307d96448d81182b7ccc5e4388d6726495a18df26b076e27b3cbf57096a5c3c8326c00f2dea SHA512 8cee64ab396dae79866e961aeabdb9a4174e1339bcd5c0a35f23fee97ca2a61c0cb08f7152d7e0db90c387400c5c6fb3da2dd2124ce9bf97dfffe6f3b4967981
diff --git a/dev-python/psutil/files/psutil-5.7.0-tests.patch b/dev-python/psutil/files/psutil-5.7.0-tests.patch
new file mode 100644 (file)
index 0000000..2def497
--- /dev/null
@@ -0,0 +1,113 @@
+From e910d08976e00bc12b5a516daa9e6a6d42d48354 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 19 Feb 2020 07:27:32 +0100
+Subject: [PATCH] Skip broken tests on Gentoo
+
+---
+ psutil/tests/test_linux.py   | 8 ++++++++
+ psutil/tests/test_posix.py   | 1 +
+ psutil/tests/test_process.py | 2 ++
+ psutil/tests/test_system.py  | 1 +
+ 4 files changed, 12 insertions(+)
+
+diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py
+index e51f8bd5..48527ccb 100755
+--- a/psutil/tests/test_linux.py
++++ b/psutil/tests/test_linux.py
+@@ -17,6 +17,7 @@ import re
+ import shutil
+ import socket
+ import struct
++import sys
+ import tempfile
+ import textwrap
+ import time
+@@ -381,6 +382,8 @@ class TestSystemVirtualMemory(unittest.TestCase):
+                 ret = psutil.virtual_memory()
+             assert m.called
+             self.assertEqual(ret.available, 2057400 * 1024 + 4818144 * 1024)
++            if sys.version_info < (3,):
++                return
+             w = ws[0]
+             self.assertIn(
+                 "inactive memory stats couldn't be determined", str(w.message))
+@@ -411,6 +414,8 @@ class TestSystemVirtualMemory(unittest.TestCase):
+                     ret = psutil.virtual_memory()
+                     self.assertEqual(
+                         ret.available, 2057400 * 1024 + 4818144 * 1024)
++                    if sys.version_info < (3,):
++                        return
+                     w = ws[0]
+                     self.assertIn(
+                         "inactive memory stats couldn't be determined",
+@@ -882,6 +887,7 @@ class TestLoadAvg(unittest.TestCase):
+ @unittest.skipIf(not LINUX, "LINUX only")
+ class TestSystemNetIfAddrs(unittest.TestCase):
++    @unittest.skip("broken on Gentoo")
+     def test_ips(self):
+         for name, addrs in psutil.net_if_addrs().items():
+             for addr in addrs:
+@@ -1364,6 +1370,7 @@ class TestMisc(unittest.TestCase):
+             psutil.PROCFS_PATH = "/proc"
+             os.rmdir(tdir)
++    @unittest.skip("broken on Gentoo")
+     def test_issue_687(self):
+         # In case of thread ID:
+         # - pid_exists() is supposed to return False
+@@ -2073,6 +2080,7 @@ class TestProcessAgainstStatus(unittest.TestCase):
+         value = self.read_status_file("nonvoluntary_ctxt_switches:")
+         self.assertEqual(self.proc.num_ctx_switches().involuntary, value)
++    @unittest.skip("broken on Gentoo")
+     def test_cpu_affinity(self):
+         value = self.read_status_file("Cpus_allowed_list:")
+         if '-' in str(value):
+diff --git a/psutil/tests/test_posix.py b/psutil/tests/test_posix.py
+index a96b310f..70199203 100755
+--- a/psutil/tests/test_posix.py
++++ b/psutil/tests/test_posix.py
+@@ -364,6 +364,7 @@ class TestSystemAPIs(unittest.TestCase):
+                     "couldn't find %s nic in 'ifconfig -a' output\n%s" % (
+                         nic, output))
++    @unittest.skip("broken on Gentoo")
+     @unittest.skipIf(CI_TESTING and not psutil.users(), "unreliable on CI")
+     @retry_on_failure()
+     def test_users(self):
+diff --git a/psutil/tests/test_process.py b/psutil/tests/test_process.py
+index 987bdf38..cb04f3ef 100755
+--- a/psutil/tests/test_process.py
++++ b/psutil/tests/test_process.py
+@@ -350,6 +350,7 @@ class TestProcess(unittest.TestCase):
+             self.assertGreaterEqual(io2[i], 0)
+             self.assertGreaterEqual(io2[i], 0)
++    @unittest.skip("fails if builder is ioniced already")
+     @unittest.skipIf(not HAS_IONICE, "not supported")
+     @unittest.skipIf(not LINUX, "linux only")
+     def test_ionice_linux(self):
+@@ -1495,6 +1496,7 @@ class TestProcess(unittest.TestCase):
+         d2 = clean_dict(os.environ.copy())
+         self.assertEqual(d1, d2)
++    @unittest.skip("broken by sandbox")
+     @unittest.skipIf(not HAS_ENVIRON, "not supported")
+     @unittest.skipIf(not POSIX, "POSIX only")
+     def test_weird_environ(self):
+diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py
+index 3834209f..b07b5883 100755
+--- a/psutil/tests/test_system.py
++++ b/psutil/tests/test_system.py
+@@ -215,6 +215,7 @@ class TestMiscAPIs(unittest.TestCase):
+         self.assertGreater(bt, 0)
+         self.assertLess(bt, time.time())
++    @unittest.skip("broken on Gentoo")
+     @unittest.skipIf(CI_TESTING and not psutil.users(), "unreliable on CI")
+     def test_users(self):
+         users = psutil.users()
+-- 
+2.25.1
+
diff --git a/dev-python/psutil/psutil-5.7.0.ebuild b/dev-python/psutil/psutil-5.7.0.ebuild
new file mode 100644 (file)
index 0000000..7940191
--- /dev/null
@@ -0,0 +1,49 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python{2_7,3_{6,7,8}} pypy3 )
+
+inherit distutils-r1
+
+DESCRIPTION="Retrieve information on running processes and system utilization"
+HOMEPAGE="https://github.com/giampaolo/psutil https://pypi.org/project/psutil/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+       dev-python/setuptools[${PYTHON_USEDEP}]
+       test? (
+               $(python_gen_cond_dep '
+                       dev-python/mock[${PYTHON_USEDEP}]
+                       dev-python/ipaddress[${PYTHON_USEDEP}]
+               ' -2)
+       )
+"
+
+PATCHES=(
+       "${FILESDIR}/psutil-5.7.0-tests.patch"
+)
+
+python_test() {
+       if [[ ${EPYTHON} == pypy* ]]; then
+               ewarn "Not running tests on ${EPYTHON} since they are broken"
+               return 0
+       fi
+
+       # since we are running in an environment a bit similar to CI,
+       # let's skip the tests that are disable for CI
+       TRAVIS=1 APPVEYOR=1 "${EPYTHON}" psutil/tests/runner.py ||
+               die "tests failed with ${EPYTHON}"
+}
+
+python_compile() {
+       # force -j1 to avoid .o linking race conditions
+       local MAKEOPTS=-j1
+       distutils-r1_python_compile
+}