From b5548b46a544ff8f4b3e44696c6b77902b44c509 Mon Sep 17 00:00:00 2001 From: jonathanspw Date: Sun, 31 Jul 2022 00:59:37 -0500 Subject: [PATCH] Update to 5.9.1. Fixes rhbz#2036137 --- python-psutil-add-tolerance.patch | 25 ----------- python-psutil-skip-tests-in-mock.patch | 58 ++++++++++++++++---------- python-psutil.spec | 10 ++--- sources | 2 +- 4 files changed, 41 insertions(+), 54 deletions(-) delete mode 100644 python-psutil-add-tolerance.patch diff --git a/python-psutil-add-tolerance.patch b/python-psutil-add-tolerance.patch deleted file mode 100644 index 8c41db4..0000000 --- a/python-psutil-add-tolerance.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 4ffbcb458ff0b838f2bfe387b6305c4817e363ae Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Thu, 15 Apr 2021 17:07:38 +0200 -Subject: [PATCH] Add tolerance to - test_linux.TestSystemVirtualMemory.test_total - -We see this test as very flaky without tolerance in Fedora and CentOS ---- - psutil/tests/test_linux.py | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py -index 0c6d498c8..f5243c2cd 100755 ---- a/psutil/tests/test_linux.py -+++ b/psutil/tests/test_linux.py -@@ -243,7 +243,8 @@ def test_total(self): - # self.assertEqual(free_value, psutil_value) - vmstat_value = vmstat('total memory') * 1024 - psutil_value = psutil.virtual_memory().total -- self.assertAlmostEqual(vmstat_value, psutil_value) -+ self.assertAlmostEqual( -+ vmstat_value, psutil_value, delta=TOLERANCE_SYS_MEM) - - @retry_on_failure() - def test_used(self): diff --git a/python-psutil-skip-tests-in-mock.patch b/python-psutil-skip-tests-in-mock.patch index 93a2e1c..81420e0 100644 --- a/python-psutil-skip-tests-in-mock.patch +++ b/python-psutil-skip-tests-in-mock.patch @@ -18,15 +18,6 @@ diff --color -Nur psutil-release-5.8.0.orig/psutil/tests/test_linux.py psutil-re def test_against_nproc(self): num = int(sh("nproc --all")) self.assertEqual(psutil.cpu_count(logical=True), num) -@@ -713,7 +712,7 @@ - m.called - - --@unittest.skipIf(not LINUX, "LINUX only") -+@unittest.skip("Unreliable in mock") - class TestSystemCPUCountPhysical(PsutilTestCase): - - @unittest.skipIf(not which("lscpu"), "lscpu utility not available") @@ -745,7 +744,7 @@ @unittest.skipIf(not LINUX, "LINUX only") class TestSystemCPUFrequency(PsutilTestCase): @@ -70,18 +61,40 @@ diff --color -Nur psutil-release-5.8.0.orig/psutil/tests/test_linux.py psutil-re def test_cpu_affinity(self): value = self.read_status_file("Cpus_allowed_list:") if '-' in str(value): -diff --color -Nur psutil-release-5.8.0.orig/psutil/tests/test_misc.py psutil-release-5.8.0/psutil/tests/test_misc.py ---- psutil-release-5.8.0.orig/psutil/tests/test_misc.py 2020-12-18 16:45:00.000000000 -0800 -+++ psutil-release-5.8.0/psutil/tests/test_misc.py 2021-01-10 15:38:31.104890945 -0800 -@@ -355,7 +355,7 @@ - - def test_setup_script(self): - setup_py = os.path.join(ROOT_DIR, 'setup.py') -- if CI_TESTING and not os.path.exists(setup_py): -+ if not os.path.exists(setup_py): - return self.skipTest("can't find setup.py") - module = import_module_by_path(setup_py) - self.assertRaises(SystemExit, module.setup) +diff -uNr psutil-release-5.9.1.orig/psutil/tests/test_linux.py psutil-release-5.9.1/psutil/tests/test_linux.py +--- psutil-release-5.9.1.orig/psutil/tests/test_linux.py 2022-07-31 00:44:02.758574274 -0500 ++++ psutil-release-5.9.1/psutil/tests/test_linux.py 2022-07-31 00:57:10.164798702 -0500 +@@ -727,7 +727,7 @@ + m.called + + +-@unittest.skipIf(not LINUX, "LINUX only") ++@unittest.skip("Unreliable in mock") + class TestSystemCPUCountCores(PsutilTestCase): + + @unittest.skipIf(not which("lscpu"), "lscpu utility not available") +@@ -1294,6 +1294,7 @@ + finder.ask_sys_class_block() + + @unittest.skipIf(GITHUB_ACTIONS, "unsupported on GITHUB_ACTIONS") ++ @unittest.skip("Unreliable in mock") + def test_comparisons(self): + finder = RootFsDeviceFinder() + self.assertIsNotNone(finder.find()) +@@ -1316,11 +1317,13 @@ + + @unittest.skipIf(not which("findmnt"), "findmnt utility not available") + @unittest.skipIf(GITHUB_ACTIONS, "unsupported on GITHUB_ACTIONS") ++ @unittest.skip("Unreliable in mock") + def test_against_findmnt(self): + psutil_value = RootFsDeviceFinder().find() + findmnt_value = sh("findmnt -o SOURCE -rn /") + self.assertEqual(psutil_value, findmnt_value) + ++ @unittest.skip("Unreliable in mock") + def test_disk_partitions_mocked(self): + with mock.patch( + 'psutil._pslinux.cext.disk_partitions', diff --color -Nur psutil-release-5.8.0.orig/psutil/tests/test_system.py psutil-release-5.8.0/psutil/tests/test_system.py --- psutil-release-5.8.0.orig/psutil/tests/test_system.py 2020-12-18 16:45:00.000000000 -0800 +++ psutil-release-5.8.0/psutil/tests/test_system.py 2021-01-10 15:38:31.105890946 -0800 @@ -98,7 +111,7 @@ diff --color -Nur psutil-release-5.8.0.orig/psutil/tests/test_system.py psutil-r if not AIX and name in ('ctx_switches', 'interrupts'): self.assertGreater(value, 0) -- @unittest.skipIf(not HAS_CPU_FREQ, "not suported") +- @unittest.skipIf(not HAS_CPU_FREQ, "not supported") + @unittest.skip("Unreliable in mock") def test_cpu_freq(self): def check_ls(ls): @@ -131,4 +144,3 @@ diff --color -Nur psutil-release-5.8.0.orig/psutil/tests/test_testutils.py psuti + @unittest.skip("Unreliable in mock") def test_leak_mem(self): ls = [] - diff --git a/python-psutil.spec b/python-psutil.spec index 9ccbde1..35e84d7 100644 --- a/python-psutil.spec +++ b/python-psutil.spec @@ -2,8 +2,8 @@ %global sum A process and system utilities module for Python Name: python-%{srcname} -Version: 5.8.0 -Release: 16%{?dist} +Version: 5.9.1 +Release: 1%{?dist} Summary: %{sum} License: BSD @@ -14,9 +14,6 @@ Source0: %{url}/archive/release-%{version}/%{srcname}-%{version}.tar.gz # Patch0: python-psutil-skip-tests-in-mock.patch -# Add tolerance to psutil.tests.test_linux.TestSystemVirtualMemory.test_total -Patch1: https://github.com/giampaolo/psutil/pull/1935.patch#/python-psutil-add-tolerance.patch - BuildRequires: gcc BuildRequires: grep BuildRequires: make @@ -94,6 +91,9 @@ make test APPVEYOR=1 PYTHON=%{__python3} PYTHONPATH=%{buildroot}/%{python3_sitea %changelog +* Sun Jul 31 2022 Jonathan Wright - 5.8.0-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/sources b/sources index e7f8fc8..5a9c86f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (psutil-5.8.0.tar.gz) = 156dffb660fcfb23b420d0455296c6b1ab366844390706af40788d89335eb946bb2e66f792755071c09ca282ad0d5503bb62175344753c88ba35613756e22fa3 +SHA512 (psutil-5.9.1.tar.gz) = 44008ce813157c09772420c1c5d1f02bc47648286f451e61d3976d36f0c45a7f520bdaaeb59701197ddcb3d7b50b2c83b55190f10667edbf216e44bf08d1eca8