diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-03-20 00:40:44 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-03-20 00:40:44 +0000 |
commit | 4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch) | |
tree | 356496503d52354aa6d9f2d36126302fed5f3a73 /dev-python/psutil | |
parent | fcc5224904648a8e6eb528d7603154160a20022f (diff) |
gentoo resync : 20.03.2022
Diffstat (limited to 'dev-python/psutil')
-rw-r--r-- | dev-python/psutil/Manifest | 3 | ||||
-rw-r--r-- | dev-python/psutil/files/psutil-5.9.0-tests.patch | 188 | ||||
-rw-r--r-- | dev-python/psutil/psutil-5.9.0.ebuild | 45 |
3 files changed, 236 insertions, 0 deletions
diff --git a/dev-python/psutil/Manifest b/dev-python/psutil/Manifest index 1220f4837d1b..578f4d6d83c1 100644 --- a/dev-python/psutil/Manifest +++ b/dev-python/psutil/Manifest @@ -1,4 +1,7 @@ AUX psutil-5.7.2-tests.patch 4427 BLAKE2B 8b2847eb445eb39080123dc1018ccf8c68c0ceb88538d9abef454724d298225ba3f65f735fd8528d3ed22d4f463e8025677144442ac471aeeea44bbe7c607d55 SHA512 46145825084b5d09e2dfa7f7b765757a8d5ac7ff2379ae66bb628ea30f010daff2fe9d389f7846a1f63f9b03c4b7bd8ac4f4d07a4ed977e06a68b63a4e27231b +AUX psutil-5.9.0-tests.patch 8186 BLAKE2B d94b5fb91bbe0f05d5452a95aa855d9c3fd50b6cb1e2fbd5e0403be6ac381574676fa0479356e0b22c5a08936040d6e4e52f684112d509749edd7c38473e413b SHA512 13939d4b03a9cc9387c48dd5a1e4f756ed77eb86ec10cee7733c8f3afb307aa7e5b89016a36e8022f912bd920274168da42f3b2c0d742d8afb2cc7528f643ecc DIST psutil-5.7.3.tar.gz 465556 BLAKE2B 6a9f31fcba571f381c1f4c904a9ff65659d13ed64e91df478aa7df4dabb87a35c4fbd9c0491a3d10b9eaf0fdcc8f2407fcf7144e729043eda605dfe6e6f93844 SHA512 8fcff56dd4e4c1b877c09023721e6f562424f7f84ae5304d518976a1e7f21dd026772f1abfc063bdd0857a375bc869f42febde090dc0b65918d1ebf44e3ad71d +DIST psutil-5.9.0.tar.gz 478322 BLAKE2B 763c8ae14ae546bed64a360047d2ce38783e9e7e939160f751c4ccc94b8e023aaa4cdca426f584e05dae8b1326333660e216d7cb3edd820e24a931dddfa5160f SHA512 b521cfce51e90fdf87ba19bf8069877e3210aede92c17460ea0b00324a36e133168e4bff550462d07ab6d93c597c6560d68954340031ff43168d54a8e5d4c4e7 EBUILD psutil-5.7.3.ebuild 1159 BLAKE2B 4fa7f8b093a37f710ce13ef630afa8086774d7a2b01bafd38c73f423480bf44ac8bffcaae38af7f2ffb5e7e4115d1703adabeeba3de454f5fe420b9cac404928 SHA512 6303bce4bfeab4a1aded7dc91ef498a4beb4a92d48484421c650f92909d29964bd63e105f6ba96621ad9e80b79c87b5cc77f32bae9a268e71bf5b72dda738a70 +EBUILD psutil-5.9.0.ebuild 1274 BLAKE2B 530351df4a3f5cae2bc9e74fc6737b10929f9a4a635cbc18c97882b5525249b5d4f3d23760b86de0b43c3f626f90beef49053b7a561ef908561f746b63c4aa72 SHA512 cbc0ba759e5354427c668f9dcbee882404d12e171803f6014a535f0a402a0dce7b044df0c45ed23bba79dd236422fa01ce4d4faf68b148b20f006aa170c10d13 MISC metadata.xml 378 BLAKE2B 235c056a427ab18383c401143074ec62b91d471087c34e2bd48d5192c6221e089e32170d18cd0d69d51eb2bb02fb8a0efe59245af9224b284557812b32c341b5 SHA512 96492308dac753fb176e4810efa71757e66413d16589e52a942b02c91256b48f9873b53a698006923aef12aa7d1539d6fd7aa07632c073b6a92cc8920f6ce6c0 diff --git a/dev-python/psutil/files/psutil-5.9.0-tests.patch b/dev-python/psutil/files/psutil-5.9.0-tests.patch new file mode 100644 index 000000000000..56a5e1168733 --- /dev/null +++ b/dev-python/psutil/files/psutil-5.9.0-tests.patch @@ -0,0 +1,188 @@ +diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py +index 21bb3e61..6c45c9e0 100644 +--- a/psutil/tests/__init__.py ++++ b/psutil/tests/__init__.py +@@ -88,6 +88,7 @@ __all__ = [ + "HAS_IONICE", "HAS_MEMORY_MAPS", "HAS_PROC_CPU_NUM", "HAS_RLIMIT", + "HAS_SENSORS_BATTERY", "HAS_BATTERY", "HAS_SENSORS_FANS", + "HAS_SENSORS_TEMPERATURES", "HAS_MEMORY_FULL_INFO", ++ "GENTOO_TESTING", + # subprocesses + 'pyrun', 'terminate', 'reap_children', 'spawn_testproc', 'spawn_zombie', + 'spawn_children_pair', +@@ -128,6 +129,7 @@ PYPY = '__pypy__' in sys.builtin_module_names + APPVEYOR = 'APPVEYOR' in os.environ + GITHUB_ACTIONS = 'GITHUB_ACTIONS' in os.environ or 'CIBUILDWHEEL' in os.environ + CI_TESTING = APPVEYOR or GITHUB_ACTIONS ++GENTOO_TESTING = "GENTOO_TESTING" in os.environ + # are we a 64 bit process? + IS_64BIT = sys.maxsize > 2 ** 32 + +diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py +index 20e28d29..ce5d10a0 100755 +--- a/psutil/tests/test_linux.py ++++ b/psutil/tests/test_linux.py +@@ -28,6 +28,7 @@ from psutil._compat import PY3 + from psutil._compat import FileNotFoundError + from psutil._compat import basestring + from psutil._compat import u ++from psutil.tests import GENTOO_TESTING + from psutil.tests import GITHUB_ACTIONS + from psutil.tests import GLOBAL_TIMEOUT + from psutil.tests import HAS_BATTERY +@@ -929,6 +930,7 @@ class TestLoadAvg(PsutilTestCase): + @unittest.skipIf(not LINUX, "LINUX only") + class TestSystemNetIfAddrs(PsutilTestCase): + ++ @unittest.skipIf(GENTOO_TESTING, "broken in Gentoo test env") + def test_ips(self): + for name, addrs in psutil.net_if_addrs().items(): + for addr in addrs: +@@ -1491,6 +1493,7 @@ class TestMisc(PsutilTestCase): + psutil.PROCFS_PATH = "/proc" + + @retry_on_failure() ++ @unittest.skipIf(GENTOO_TESTING, "broken in Gentoo test env") + def test_issue_687(self): + # In case of thread ID: + # - pid_exists() is supposed to return False +@@ -1596,6 +1599,8 @@ class TestSensorsBattery(PsutilTestCase): + self.assertEqual(psutil.sensors_battery().power_plugged, False) + assert m.called + ++ @unittest.skipIf(GENTOO_TESTING, ++ "mocking doesn't work with non-BAT0 battery") + def test_emulate_power_undetermined(self): + # Pretend we can't know whether the AC power cable not + # connected (assert fallback to False). +@@ -1614,6 +1619,8 @@ class TestSensorsBattery(PsutilTestCase): + self.assertIsNone(psutil.sensors_battery().power_plugged) + assert m.called + ++ @unittest.skipIf(GENTOO_TESTING, ++ "mocking doesn't work with non-BAT0 battery") + def test_emulate_energy_full_0(self): + # Emulate a case where energy_full files returns 0. + with mock_open_content( +@@ -1621,6 +1628,8 @@ class TestSensorsBattery(PsutilTestCase): + self.assertEqual(psutil.sensors_battery().percent, 0) + assert m.called + ++ @unittest.skipIf(GENTOO_TESTING, ++ "mocking doesn't work with non-BAT0 battery") + def test_emulate_energy_full_not_avail(self): + # Emulate a case where energy_full file does not exist. + # Expected fallback on /capacity. +@@ -1634,6 +1643,8 @@ class TestSensorsBattery(PsutilTestCase): + "/sys/class/power_supply/BAT0/capacity", b"88"): + self.assertEqual(psutil.sensors_battery().percent, 88) + ++ @unittest.skipIf(GENTOO_TESTING, ++ "mocking doesn't work with non-BAT0 battery") + def test_emulate_no_power(self): + # Emulate a case where /AC0/online file nor /BAT0/status exist. + with mock_open_exception( +@@ -2220,6 +2231,7 @@ class TestProcessAgainstStatus(PsutilTestCase): + value = self.read_status_file("nonvoluntary_ctxt_switches:") + self.assertEqual(self.proc.num_ctx_switches().involuntary, value) + ++ @unittest.skipIf(GENTOO_TESTING, "broken in Gentoo test env") + def test_cpu_affinity(self): + value = self.read_status_file("Cpus_allowed_list:") + if '-' in str(value): +diff --git a/psutil/tests/test_misc.py b/psutil/tests/test_misc.py +index d946eb62..a53de565 100755 +--- a/psutil/tests/test_misc.py ++++ b/psutil/tests/test_misc.py +@@ -32,6 +32,7 @@ from psutil._compat import PY3 + from psutil._compat import redirect_stderr + from psutil.tests import APPVEYOR + from psutil.tests import CI_TESTING ++from psutil.tests import GENTOO_TESTING + from psutil.tests import HAS_BATTERY + from psutil.tests import HAS_MEMORY_MAPS + from psutil.tests import HAS_NET_IO_COUNTERS +@@ -401,6 +402,7 @@ class TestMisc(PsutilTestCase): + reload_module(psutil) + self.assertIn("version conflict", str(cm.exception).lower()) + ++ @unittest.skipIf(GENTOO_TESTING, "broken in Gentoo test env") + def test_debug(self): + if PY3: + from io import StringIO +diff --git a/psutil/tests/test_posix.py b/psutil/tests/test_posix.py +index 31b81926..7eb9bac5 100755 +--- a/psutil/tests/test_posix.py ++++ b/psutil/tests/test_posix.py +@@ -23,6 +23,7 @@ from psutil import OPENBSD + from psutil import POSIX + from psutil import SUNOS + from psutil.tests import CI_TESTING ++from psutil.tests import GENTOO_TESTING + from psutil.tests import HAS_NET_IO_COUNTERS + from psutil.tests import PYTHON_EXE + from psutil.tests import PsutilTestCase +@@ -326,6 +327,7 @@ class TestSystemAPIs(PsutilTestCase): + "couldn't find %s nic in 'ifconfig -a' output\n%s" % ( + nic, output)) + ++ @unittest.skipIf(GENTOO_TESTING, "broken in Gentoo test env") + @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 c9059e33..0050c42a 100755 +--- a/psutil/tests/test_process.py ++++ b/psutil/tests/test_process.py +@@ -38,6 +38,7 @@ from psutil._compat import long + from psutil._compat import super + from psutil.tests import APPVEYOR + from psutil.tests import CI_TESTING ++from psutil.tests import GENTOO_TESTING + from psutil.tests import GITHUB_ACTIONS + from psutil.tests import GLOBAL_TIMEOUT + from psutil.tests import HAS_CPU_AFFINITY +@@ -292,6 +293,7 @@ class TestProcess(PsutilTestCase): + time.strftime("%Y %m %d %H:%M:%S", time.localtime(p.create_time())) + + @unittest.skipIf(not POSIX, 'POSIX only') ++ @unittest.skipIf(GENTOO_TESTING, "broken in Gentoo test env") + def test_terminal(self): + terminal = psutil.Process().terminal() + if terminal is not None: +@@ -341,6 +343,7 @@ class TestProcess(PsutilTestCase): + self.assertGreaterEqual(io2[i], 0) + self.assertGreaterEqual(io2[i], 0) + ++ @unittest.skipIf(GENTOO_TESTING, "fails if builder is ioniced already") + @unittest.skipIf(not HAS_IONICE, "not supported") + @unittest.skipIf(not LINUX, "linux only") + def test_ionice_linux(self): +@@ -1406,6 +1409,7 @@ class TestProcess(PsutilTestCase): + if not OSX and GITHUB_ACTIONS: + self.assertEqual(d1, d2) + ++ @unittest.skipIf(GENTOO_TESTING, "broken by Gentoo 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 db2cb348..b1faa154 100755 +--- a/psutil/tests/test_system.py ++++ b/psutil/tests/test_system.py +@@ -33,6 +33,7 @@ from psutil._compat import long + from psutil.tests import ASCII_FS + from psutil.tests import CI_TESTING + from psutil.tests import DEVNULL ++from psutil.tests import GENTOO_TESTING + from psutil.tests import GITHUB_ACTIONS + from psutil.tests import GLOBAL_TIMEOUT + from psutil.tests import HAS_BATTERY +@@ -199,6 +200,7 @@ class TestMiscAPIs(PsutilTestCase): + self.assertGreater(bt, 0) + self.assertLess(bt, time.time()) + ++ @unittest.skipIf(GENTOO_TESTING, "broken in Gentoo test env") + @unittest.skipIf(CI_TESTING and not psutil.users(), "unreliable on CI") + def test_users(self): + users = psutil.users() diff --git a/dev-python/psutil/psutil-5.9.0.ebuild b/dev-python/psutil/psutil-5.9.0.ebuild new file mode 100644 index 000000000000..00a12bc0d760 --- /dev/null +++ b/dev-python/psutil/psutil-5.9.0.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{8..10} 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 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="test" +RESTRICT="!test? ( test )" + +PATCHES=( + "${FILESDIR}"/psutil-5.9.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 + local -x TRAVIS=1 + local -x APPVEYOR=1 + local -x GITHUB_ACTIONS=1 + local -x GENTOO_TESTING=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 +} |