From 3316bf44bc98fc4583a9e5223e73adb7b490907ff81203102f0b43a92d5416ca Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 20 Nov 2024 16:23:42 +0000 Subject: [PATCH] - update to 6.1.0: * 2366_, [Windows]: drastically speedup `process_iter()`_. We now determine process unique identity by using process "fast" create time method. This will considerably speedup those apps which use `process_iter()`_ only once, e.g. to look for a process with a certain name. * 2446_: use pytest instead of unittest. * 2448_: add make install-sysdeps target to install the necessary system dependencies (python-dev, gcc, etc.) on all supported UNIX flavors. * 2449_: add make install-pydeps-test and make install-pydeps- dev targets. They can be used to install dependencies meant for running tests and for local development. They can also be installed via pip install .[test] and pip install .[dev]. * 2456_: allow to run tests via python3 -m psutil.tests even if pytest module is not installed. This is useful for production environments that don't have pytest installed, but still want to be able to test psutil installation. * 2427_: psutil (segfault) on import in the free-threaded (no GIL) version of Python 3.13. (patch by Sam Gross) * 2455_, [Linux]: IndexError may occur when reading /proc/pid/stat and field 40 (blkio_ticks) is missing. * 2457_, [AIX]: significantly improve the speed of `Process.open_files()`_ for some edge cases. * 2460_, [OpenBSD]: `Process.num_fds()`_ and `Process.open_files()`_ may fail with `NoSuchProcess`_ for PID 0. Instead, we now return "null" values (0 and [] respectively). - drop skip_failing_tests.patch: obsolete OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=175 --- psutil-6.0.0.tar.gz | 3 - psutil-6.1.0.tar.gz | 3 + python-psutil.changes | 33 +++++++ python-psutil.spec | 5 +- skip_failing_tests.patch | 183 --------------------------------------- 5 files changed, 37 insertions(+), 190 deletions(-) delete mode 100644 psutil-6.0.0.tar.gz create mode 100644 psutil-6.1.0.tar.gz delete mode 100644 skip_failing_tests.patch diff --git a/psutil-6.0.0.tar.gz b/psutil-6.0.0.tar.gz deleted file mode 100644 index dce2d3c..0000000 --- a/psutil-6.0.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8faae4f310b6d969fa26ca0545338b21f73c6b15db7c4a8d934a5482faa818f2 -size 508067 diff --git a/psutil-6.1.0.tar.gz b/psutil-6.1.0.tar.gz new file mode 100644 index 0000000..996d7fc --- /dev/null +++ b/psutil-6.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:353815f59a7f64cdaca1c0307ee13558a0512f6db064e92fe833784f08539c7a +size 508565 diff --git a/python-psutil.changes b/python-psutil.changes index ab4955a..b08d6d3 100644 --- a/python-psutil.changes +++ b/python-psutil.changes @@ -1,3 +1,36 @@ +------------------------------------------------------------------- +Wed Nov 20 16:23:16 UTC 2024 - Dirk Müller + +- update to 6.1.0: + * 2366_, [Windows]: drastically speedup `process_iter()`_. We + now determine process unique identity by using process "fast" + create time method. This will considerably speedup those apps + which use `process_iter()`_ only once, e.g. to look for a + process with a certain name. + * 2446_: use pytest instead of unittest. + * 2448_: add make install-sysdeps target to install the + necessary system dependencies (python-dev, gcc, etc.) on all + supported UNIX flavors. + * 2449_: add make install-pydeps-test and make install-pydeps- + dev targets. They can be used to install dependencies meant + for running tests and for local development. They can also be + installed via pip install .[test] and pip install .[dev]. + * 2456_: allow to run tests via python3 -m psutil.tests even if + pytest module is not installed. This is useful for production + environments that don't have pytest installed, but still want + to be able to test psutil installation. + * 2427_: psutil (segfault) on import in the free-threaded (no + GIL) version of Python 3.13. (patch by Sam Gross) + * 2455_, [Linux]: IndexError may occur when reading + /proc/pid/stat and field 40 (blkio_ticks) is missing. + * 2457_, [AIX]: significantly improve the speed of + `Process.open_files()`_ for some edge cases. + * 2460_, [OpenBSD]: `Process.num_fds()`_ and + `Process.open_files()`_ may fail with `NoSuchProcess`_ for + PID 0. Instead, we now return "null" values (0 and [] + respectively). +- drop skip_failing_tests.patch: obsolete + ------------------------------------------------------------------- Wed Jul 17 12:33:03 UTC 2024 - John Paul Adrian Glaubitz diff --git a/python-psutil.spec b/python-psutil.spec index 99b7ae6..1090f82 100644 --- a/python-psutil.spec +++ b/python-psutil.spec @@ -23,15 +23,12 @@ %endif %{?sle15_python_module_pythons} Name: python-psutil -Version: 6.0.0 +Version: 6.1.0 Release: 0 Summary: A process utilities module for Python License: BSD-3-Clause URL: https://github.com/giampaolo/psutil Source: https://files.pythonhosted.org/packages/source/p/psutil/psutil-%{version}.tar.gz -# PATCH-FIX-UPSTREAM skip_failing_tests.patch gh#giampaolo/psutil#1635 mcepl@suse.com -# skip tests failing because of incomplete emulation of the environment in osc build -Patch2: skip_failing_tests.patch # PATCH-FIX-SLE adopt change of used memory of procps Patch4: mem-used-bsc1181475.patch BuildRequires: %{python_module devel} diff --git a/skip_failing_tests.patch b/skip_failing_tests.patch deleted file mode 100644 index 86a190d..0000000 --- a/skip_failing_tests.patch +++ /dev/null @@ -1,183 +0,0 @@ -diff -Nru psutil-6.0.0.orig/psutil/tests/test_contracts.py psutil-6.0.0/psutil/tests/test_contracts.py ---- psutil-6.0.0.orig/psutil/tests/test_contracts.py 2024-06-18 22:36:40.000000000 +0200 -+++ psutil-6.0.0/psutil/tests/test_contracts.py 2024-07-17 14:20:15.685789923 +0200 -@@ -249,6 +249,7 @@ - self.assertIsInstance(k, str) - self.assert_ntuple_of_nums(v, type_=(int, long)) - -+ @unittest.skip("Fails in OBS") - def test_disk_partitions(self): - # Duplicate of test_system.py. Keep it anyway. - for disk in psutil.disk_partitions(): -diff -Nru psutil-6.0.0.orig/psutil/tests/test_linux.py psutil-6.0.0/psutil/tests/test_linux.py ---- psutil-6.0.0.orig/psutil/tests/test_linux.py 2024-06-18 23:00:36.000000000 +0200 -+++ psutil-6.0.0/psutil/tests/test_linux.py 2024-07-17 14:20:15.685789923 +0200 -@@ -756,6 +756,7 @@ - self.assertEqual(psutil.cpu_count(logical=True), num) - - @unittest.skipIf(not which("lscpu"), "lscpu utility not available") -+ @unittest.skip("Fails in OBS") - def test_against_lscpu(self): - out = sh("lscpu -p") - num = len([x for x in out.split('\n') if not x.startswith('#')]) -@@ -801,6 +802,7 @@ - @unittest.skipIf(not LINUX, "LINUX only") - class TestSystemCPUCountCores(PsutilTestCase): - @unittest.skipIf(not which("lscpu"), "lscpu utility not available") -+ @unittest.skip("Fails in OBS") - def test_against_lscpu(self): - out = sh("lscpu -p") - core_ids = set() -@@ -1196,6 +1198,7 @@ - class TestSystemDiskPartitions(PsutilTestCase): - @unittest.skipIf(not hasattr(os, 'statvfs'), "os.statvfs() not available") - @skip_on_not_implemented() -+ @unittest.skip("Fails in OBS") - def test_against_df(self): - # test psutil.disk_usage() and psutil.disk_partitions() - # against "df -a" -@@ -1374,6 +1377,7 @@ - self.assertEqual(ret.read_count, 1) - self.assertEqual(ret.write_count, 5) - -+ @unittest.skip("Fails in OBS") - def test_emulate_use_sysfs(self): - def exists(path): - return path == '/proc/diskstats' -@@ -1417,6 +1421,7 @@ - finder.ask_sys_class_block() - - @unittest.skipIf(GITHUB_ACTIONS, "unsupported on GITHUB_ACTIONS") -+ @unittest.skip("Fails in OBS") - def test_comparisons(self): - finder = RootFsDeviceFinder() - self.assertIsNotNone(finder.find()) -@@ -1445,6 +1450,7 @@ - findmnt_value = sh("findmnt -o SOURCE -rn /") - self.assertEqual(psutil_value, findmnt_value) - -+ @unittest.skip("Fails in OBS") - def test_disk_partitions_mocked(self): - with mock.patch( - 'psutil._pslinux.cext.disk_partitions', -@@ -1728,6 +1734,8 @@ - self.assertIsNone(psutil.sensors_battery().power_plugged) - assert m.called - -+ @unittest.skipUnless(os.path.exists('/sys/class/power_supply/BAT0/energy_full'), -+ 'Missing /sys/class/power_supply/BAT0/energy_full file.') - def test_emulate_energy_full_0(self): - # Emulate a case where energy_full files returns 0. - with mock_open_content( -@@ -1736,6 +1744,8 @@ - self.assertEqual(psutil.sensors_battery().percent, 0) - assert m.called - -+ @unittest.skipUnless(os.path.exists('/sys/class/power_supply/BAT0/energy_full'), -+ 'Missing /sys/class/power_supply/BAT0/energy_full file.') - def test_emulate_energy_full_not_avail(self): - # Emulate a case where energy_full file does not exist. - # Expected fallback on /capacity. -@@ -2324,6 +2334,7 @@ - value = self.read_status_file("nonvoluntary_ctxt_switches:") - self.assertEqual(self.proc.num_ctx_switches().involuntary, value) - -+ @unittest.skip("Fails in certain OBS environments") - def test_cpu_affinity(self): - value = self.read_status_file("Cpus_allowed_list:") - if '-' in str(value): -diff -Nru psutil-6.0.0.orig/psutil/tests/test_misc.py psutil-6.0.0/psutil/tests/test_misc.py ---- psutil-6.0.0.orig/psutil/tests/test_misc.py 2024-06-18 22:36:40.000000000 +0200 -+++ psutil-6.0.0/psutil/tests/test_misc.py 2024-07-17 14:20:15.682456583 +0200 -@@ -343,6 +343,7 @@ - - # # XXX: https://github.com/pypa/setuptools/pull/2896 - # @unittest.skipIf(APPVEYOR, "temporarily disabled due to setuptools bug") -+ # @unittest.skip("Fails in OBS") - # def test_setup_script(self): - # setup_py = os.path.join(ROOT_DIR, 'setup.py') - # if CI_TESTING and not os.path.exists(setup_py): -@@ -966,6 +967,7 @@ - src = f.read() - ast.parse(src) - -+ @unittest.skip("Fails in OBS") - def test_coverage(self): - # make sure all example scripts have a test method defined - meths = dir(self) -@@ -987,6 +989,7 @@ - if not stat.S_IXUSR & os.stat(path)[stat.ST_MODE]: - raise self.fail('%r is not executable' % path) - -+ @unittest.skip("Fails in OBS") - def test_disk_usage(self): - self.assert_stdout('disk_usage.py') - -diff -Nru psutil-6.0.0.orig/psutil/tests/test_posix.py psutil-6.0.0/psutil/tests/test_posix.py ---- psutil-6.0.0.orig/psutil/tests/test_posix.py 2024-06-18 22:36:40.000000000 +0200 -+++ psutil-6.0.0/psutil/tests/test_posix.py 2024-07-17 14:20:15.685789923 +0200 -@@ -443,6 +443,7 @@ - # AIX can return '-' in df output instead of numbers, e.g. for /proc - @unittest.skipIf(AIX, "unreliable on AIX") - @retry_on_failure() -+ @unittest.skip("Fails in OBS") - def test_disk_usage(self): - def df(device): - try: -diff -Nru psutil-6.0.0.orig/psutil/tests/test_process_all.py psutil-6.0.0/psutil/tests/test_process_all.py ---- psutil-6.0.0.orig/psutil/tests/test_process_all.py 2024-06-18 23:00:36.000000000 +0200 -+++ psutil-6.0.0/psutil/tests/test_process_all.py 2024-07-17 14:28:46.700089665 +0200 -@@ -15,6 +15,7 @@ - import stat - import time - import traceback -+import unittest - - import psutil - from psutil import AIX -@@ -130,6 +131,7 @@ - ls.append(proc_info(pid)) - return ls - -+ @unittest.skip("Fails in OBS") - def test_all(self): - failures = [] - for info in self.iter_proc_info(): -diff -Nru psutil-6.0.0.orig/psutil/tests/test_process.py psutil-6.0.0/psutil/tests/test_process.py ---- psutil-6.0.0.orig/psutil/tests/test_process.py 2024-06-18 22:36:40.000000000 +0200 -+++ psutil-6.0.0/psutil/tests/test_process.py 2024-07-17 14:20:15.685789923 +0200 -@@ -360,6 +360,7 @@ - - @unittest.skipIf(not HAS_IONICE, "not supported") - @unittest.skipIf(not LINUX, "linux only") -+ @unittest.skip("Unreliable in OBS") - def test_ionice_linux(self): - def cleanup(init): - ioclass, value = init -diff -Nru psutil-6.0.0.orig/psutil/tests/test_system.py psutil-6.0.0/psutil/tests/test_system.py ---- psutil-6.0.0.orig/psutil/tests/test_system.py 2024-06-18 22:36:40.000000000 +0200 -+++ psutil-6.0.0/psutil/tests/test_system.py 2024-07-17 14:25:27.213045941 +0200 -@@ -243,6 +243,7 @@ - self.assertLess(bt, time.time()) - - @unittest.skipIf(CI_TESTING and not psutil.users(), "unreliable on CI") -+ @unittest.skip("Fails in OBS") - def test_users(self): - users = psutil.users() - self.assertNotEqual(users, []) -@@ -591,6 +592,7 @@ - MACOS and platform.machine() == 'arm64', "skipped due to #1892" - ) - @unittest.skipIf(not HAS_CPU_FREQ, "not supported") -+ @unittest.skip("Fails in OBS") - def test_cpu_freq(self): - def check_ls(ls): - for nt in ls: -@@ -662,6 +664,7 @@ - def test_disk_usage_bytes(self): - psutil.disk_usage(b'.') - -+ @unittest.skip("Fails in OBS") - def test_disk_partitions(self): - def check_ntuple(nt): - self.assertIsInstance(nt.device, str)