13 Commits

Author SHA256 Message Date
155a485af9 Accepting request 1321490 from devel:languages:python
- Only require pytest-subtests with pytest < 9.

OBS-URL: https://build.opensuse.org/request/show/1321490
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-psutil?expand=0&rev=90
2025-12-09 11:46:29 +00:00
fd33e7c702 - Only require pytest-subtests with pytest < 9.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=192
2025-12-08 04:31:54 +00:00
90373e07b4 Accepting request 1320594 from devel:languages:python
Forwarded request #1320330 from mcalabkova

- Add upstream pytest9.patch to fix tests

OBS-URL: https://build.opensuse.org/request/show/1320594
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-psutil?expand=0&rev=89
2025-12-02 12:18:52 +00:00
30b028cc03 - Add upstream pytest9.patch to fix tests
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=190
2025-11-29 22:09:45 +00:00
c9dc6de0d6 Accepting request 1317430 from devel:languages:python
Forwarded request #1317109 from mcalabkova

- Update to 7.1.3
    * Replace strlcat/strlcpy with safe str_copy/str_append
    * Introduce PSUTIL_TESTING mode. Terminate execution if str_* funcs fail
    * Replace unsafe sprintf/snprintf/sprintf_s calls with str_format()
    * Fix BSD compilation err

OBS-URL: https://build.opensuse.org/request/show/1317430
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-psutil?expand=0&rev=88
2025-11-14 15:10:48 +00:00
4c6fbf6cad - Update to 7.1.3
* Replace strlcat/strlcpy with safe str_copy/str_append
  * Introduce PSUTIL_TESTING mode. Terminate execution if str_* funcs fail
  * Replace unsafe sprintf/snprintf/sprintf_s calls with str_format()
  * Fix BSD compilation err

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=188
2025-11-12 19:13:25 +00:00
5c3f702da8 Accepting request 1315287 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1315287
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-psutil?expand=0&rev=87
2025-11-05 15:17:49 +00:00
d5fad8f15a - Update to 7.1.2
* 2657_: stop publishing prebuilt Linux and Windows wheels for 32-bit Python.
    32-bit CPython is still supported, but psutil must now be built from source.
  * 2565_: produce wheels for free-thread cPython 3.13 and 3.14 (patch by
    Lysandros Nikolaou)
  * 2650_, [macOS]: `Process.cmdline()`_ and `Process.environ()`_ may incorrectly
    raise `NoSuchProcess`_ instead of `ZombieProcess`_.
  * 2658_, [macOS]: double ``free()`` in `Process.environ()`_ when it fails
    internally. This posed a risk of segfault.
  * 2662_, [macOS]: massive C code cleanup to guard against possible segfaults
    which were (not so) sporadically spotted on CI.
  * 2657_: stop publishing prebuilt Linux and Windows wheels for 32-bit Python.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=186
2025-11-03 12:25:33 +00:00
d5ab93a32f Accepting request 1313195 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1313195
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-psutil?expand=0&rev=86
2025-10-24 15:22:59 +00:00
720ab2104b - Exclude tests to mutibuild due to dependency cycle with python-xdist
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=184
2025-10-23 10:15:01 +00:00
4a6e40f617 - Update to 7.1.1
* SunOS 10 is no longer supported.
  * Tests that needs UNIX sockets should be properly marked for skip
- Run tests with pytest (recommended by upstream)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=183
2025-10-21 00:30:20 +00:00
35319d6bb8 Accepting request 1307323 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1307323
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-psutil?expand=0&rev=85
2025-09-29 14:31:03 +00:00
a045c642a1 - Update to 7.1.0
* 2581_, [Windows]: publish ARM64 wheels.  (patch by Matthieu Darbois)
  * 2571_, [FreeBSD]: Dropped support for FreeBSD 8 and earlier. FreeBSD 8 was
    maintained from 2009 to 2013.
  * 2575_: introduced `dprint` CLI tool to format .yml and .md files.
  * 2473_, [macOS]: Fix build issue on macOS 11 and lower.
  * 2494_, [Windows]: All APIs dealing with paths, such as
    `Process.memory_maps()`_, `Process.exe()`_ and `Process.open_files()`_ does
    not properly handle UNC paths. Paths such as ``\\??\\C:\\Windows\\Temp`` and
    ``'\\Device\\HarddiskVolume1\\Windows\\Temp'`` are now converted to
    ``C:\\Windows\\Temp``.  (patch by Ben Peddell)
  * 2506_, [Windows]: Windows service APIs had issues with unicode services using
    special characters in their name.
  * 2514_, [Linux]: `Process.cwd()`_ sometimes fail with `FileNotFoundError` due
    to a race condition.
  * 2526_, [Linux]: `Process.create_time()`_, which is used to univocally
    identify a process over time, is subject to system clock updates, and as such
    can lead to `Process.is_running()`_ returning a wrong result. A monotonic
    creation time is now used instead.  (patch by Jonathan Kohler)
  * 2528_, [Linux]: `Process.children()`_ may raise ``PermissionError``. It will
    now raise `AccessDenied`_ instead.
  * 2540_, [macOS]: `boot_time()`_ is off by 45 seconds (C precision issue).
  * 2541_, 2570_, 2578_ [Linux], [macOS], [NetBSD]: `Process.create_time()`_ does
    not reflect system clock updates.
  * 2542_: if system clock is updated `Process.children()`_ and
    `Process.parent()`_ may not be able to return the right information.
  * 2545_: [Illumos]: Fix handling of MIB2_UDP_ENTRY in `net_connections()`_.
  * 2552_, [Windows]: `boot_time()`_ didn't take into account the time spent
    during suspend / hibernation.
  * 2560_, [Linux]: `Process.memory_maps()`_ may crash with `IndexError` on

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=181
2025-09-26 08:53:38 +00:00
7 changed files with 191 additions and 49 deletions

3
_multibuild Normal file
View File

@@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@@ -1,34 +0,0 @@
---
psutil/_pslinux.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Index: psutil-5.9.5/psutil/_pslinux.py
===================================================================
--- psutil-5.9.5.orig/psutil/_pslinux.py
+++ psutil-5.9.5/psutil/_pslinux.py
@@ -474,12 +474,6 @@ def virtual_memory():
except KeyError:
slab = 0
- used = total - free - cached - buffers
- if used < 0:
- # May be symptomatic of running within a LCX container where such
- # values will be dramatically distorted over those of the host.
- used = total - free
-
# - starting from 4.4.0 we match free's "available" column.
# Before 4.4.0 we calculated it as (free + buffers + cached)
# which matched htop.
@@ -510,6 +504,12 @@ def virtual_memory():
# 24fd2605c51fccc375ab0287cec33aa767f06718/proc/sysinfo.c#L764
avail = free
+ used = total - avail
+ if used < 0:
+ # May be symptomatic of running within a LCX container where such
+ # values will be dramatically distorted over those of the host.
+ used = total - free
+
percent = usage_percent((total - avail), total, round_=1)
# Warn about missing metrics which are set to 0.

Binary file not shown.

3
psutil-7.1.3.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c86281738d77335af7aec228328e944b30930899ea760ecf33a4dba66be5e74
size 489059

52
pytest9.patch Normal file
View File

@@ -0,0 +1,52 @@
From 40e27872d534ed849245fdb0c4604ca678d5e9fc Mon Sep 17 00:00:00 2001
From: Giampaolo Rodola <g.rodola@gmail.com>
Date: Sun, 23 Nov 2025 00:08:41 +0100
Subject: [PATCH] Make ntuples work with subTest of new pytest release
When running tests in parallel, the new pytest 9.X is unable to
de/serialize nametuples when passed as:
with self.subTest(foo=ntuple):
...
---
tests/test_posix.py | 2 +-
tests/test_system.py | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/psutil/tests/test_posix.py b/psutil/tests/test_posix.py
index 2cc9dbd84c..ab2c10c9f3 100755
--- a/psutil/tests/test_posix.py
+++ b/psutil/tests/test_posix.py
@@ -416,7 +416,7 @@ def test_users_started(self):
if not tstamp:
return pytest.skip(f"cannot interpret tstamp in who output\n{out}")
- with self.subTest(psutil=psutil.users(), who=out):
+ with self.subTest(psutil=str(psutil.users()), who=out):
for idx, u in enumerate(psutil.users()):
psutil_value = datetime.datetime.fromtimestamp(
u.started
diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py
index 79325c7599..c00ab6fb96 100755
--- a/psutil/tests/test_system.py
+++ b/psutil/tests/test_system.py
@@ -244,7 +244,7 @@ def test_users(self):
users = psutil.users()
assert users
for user in users:
- with self.subTest(user=user):
+ with self.subTest(user=str(user)):
assert user.name
assert isinstance(user.name, str)
assert isinstance(user.terminal, (str, type(None)))
@@ -488,7 +488,9 @@ def test_cpu_times_comparison(self):
per_cpu = psutil.cpu_times(percpu=True)
summed_values = base._make([sum(num) for num in zip(*per_cpu)])
for field in base._fields:
- with self.subTest(field=field, base=base, per_cpu=per_cpu):
+ with self.subTest(
+ field=field, base=str(base), per_cpu=str(per_cpu)
+ ):
assert (
abs(getattr(base, field) - getattr(summed_values, field))
< 2

View File

@@ -1,3 +1,98 @@
-------------------------------------------------------------------
Mon Dec 8 04:29:16 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Only require pytest-subtests with pytest < 9.
-------------------------------------------------------------------
Thu Nov 27 11:31:09 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Add upstream pytest9.patch to fix tests
-------------------------------------------------------------------
Tue Nov 11 14:02:16 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Update to 7.1.3
* Replace strlcat/strlcpy with safe str_copy/str_append
* Introduce PSUTIL_TESTING mode. Terminate execution if str_* funcs fail
* Replace unsafe sprintf/snprintf/sprintf_s calls with str_format()
* Fix BSD compilation err
-------------------------------------------------------------------
Thu Oct 30 14:15:39 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Update to 7.1.2
* 2657_: stop publishing prebuilt Linux and Windows wheels for 32-bit Python.
32-bit CPython is still supported, but psutil must now be built from source.
* 2565_: produce wheels for free-thread cPython 3.13 and 3.14 (patch by
Lysandros Nikolaou)
* 2650_, [macOS]: `Process.cmdline()`_ and `Process.environ()`_ may incorrectly
raise `NoSuchProcess`_ instead of `ZombieProcess`_.
* 2658_, [macOS]: double ``free()`` in `Process.environ()`_ when it fails
internally. This posed a risk of segfault.
* 2662_, [macOS]: massive C code cleanup to guard against possible segfaults
which were (not so) sporadically spotted on CI.
* 2657_: stop publishing prebuilt Linux and Windows wheels for 32-bit Python.
-------------------------------------------------------------------
Thu Oct 23 09:47:56 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Exclude tests to mutibuild due to dependency cycle with python-xdist
-------------------------------------------------------------------
Mon Oct 20 09:55:27 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Update to 7.1.1
* SunOS 10 is no longer supported.
* Tests that needs UNIX sockets should be properly marked for skip
- Run tests with pytest (recommended by upstream)
-------------------------------------------------------------------
Fri Sep 26 08:06:59 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Update to 7.1.0
* 2581_, [Windows]: publish ARM64 wheels. (patch by Matthieu Darbois)
* 2571_, [FreeBSD]: Dropped support for FreeBSD 8 and earlier. FreeBSD 8 was
maintained from 2009 to 2013.
* 2575_: introduced `dprint` CLI tool to format .yml and .md files.
* 2473_, [macOS]: Fix build issue on macOS 11 and lower.
* 2494_, [Windows]: All APIs dealing with paths, such as
`Process.memory_maps()`_, `Process.exe()`_ and `Process.open_files()`_ does
not properly handle UNC paths. Paths such as ``\\??\\C:\\Windows\\Temp`` and
``'\\Device\\HarddiskVolume1\\Windows\\Temp'`` are now converted to
``C:\\Windows\\Temp``. (patch by Ben Peddell)
* 2506_, [Windows]: Windows service APIs had issues with unicode services using
special characters in their name.
* 2514_, [Linux]: `Process.cwd()`_ sometimes fail with `FileNotFoundError` due
to a race condition.
* 2526_, [Linux]: `Process.create_time()`_, which is used to univocally
identify a process over time, is subject to system clock updates, and as such
can lead to `Process.is_running()`_ returning a wrong result. A monotonic
creation time is now used instead. (patch by Jonathan Kohler)
* 2528_, [Linux]: `Process.children()`_ may raise ``PermissionError``. It will
now raise `AccessDenied`_ instead.
* 2540_, [macOS]: `boot_time()`_ is off by 45 seconds (C precision issue).
* 2541_, 2570_, 2578_ [Linux], [macOS], [NetBSD]: `Process.create_time()`_ does
not reflect system clock updates.
* 2542_: if system clock is updated `Process.children()`_ and
`Process.parent()`_ may not be able to return the right information.
* 2545_: [Illumos]: Fix handling of MIB2_UDP_ENTRY in `net_connections()`_.
* 2552_, [Windows]: `boot_time()`_ didn't take into account the time spent
during suspend / hibernation.
* 2560_, [Linux]: `Process.memory_maps()`_ may crash with `IndexError` on
RISCV64 due to a malformed `/proc/{PID}/smaps` file. (patch by Julien
Stephan)
* 2586_, [macOS], [CRITICAL]: fixed different places in C code which can
trigger a segfault.
* 2604_, [Linux]: `virtual_memory()`_ "used" memory does not match recent
versions of ``free`` CLI utility. (patch by Isaac K. Ko)
* 2605_, [Linux]: `psutil.sensors_battery()` reports a negative amount for
seconds left.
* 2607_, [Windows]: ``WindowsService.description()`` method may fail with
``ERROR_NOT_FOUND``. Now it returns an empty string instead.
* 2610:, [macOS], [CRITICAL]: fix `cpu_freq()`_ segfault on ARM architectures.
* 2571_: dropped support for FreeBSD 8 and earlier.
- Drop mem-used-bsc1181475.patch, fixed upstream
-------------------------------------------------------------------
Thu May 29 08:05:29 UTC 2025 - Dirk Müller <dmueller@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-psutil
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,21 +16,28 @@
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%ifarch x86_64 %{ix86}
%define psuffix -%{flavor}
%bcond_without test
%else
%bcond_with test
ExclusiveArch: donotbuild
%endif
%else
%define psuffix %{nil}
%bcond_with test
%endif
%{?sle15_python_module_pythons}
Name: python-psutil
Version: 7.0.0
Name: python-psutil%{psuffix}
Version: 7.1.3
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-SLE adopt change of used memory of procps
Patch4: mem-used-bsc1181475.patch
# PATCH-FIX-UPSTREAM https://github.com/giampaolo/psutil/commit/40e27872d534ed849245fdb0c4604ca678d5e9fc Make ntuples work with subTest of new pytest release
Patch: pytest9.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
@@ -43,8 +50,11 @@ BuildRequires: pkgconfig(libsystemd)
%if 0%{?suse_version} > 1500
BuildRequires: /usr/bin/who
%endif
BuildRequires: %{python_module psutil = %{version}}
BuildRequires: %{python_module pytest-subtests if %python-pytest < 9}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest}
BuildRequires: net-tools
BuildRequires: procps
%endif
%python_subpackages
@@ -53,11 +63,16 @@ A graphical interface that lets you easily analyze and introspect unaltered runn
%prep
%autosetup -p1 -n psutil-%{version}
# do not require pytest-instafail
sed -i '/instafail/d' pyproject.toml
%build
%if !%{with test}
%pyproject_wheel
%endif
%install
%if !%{with test}
%pyproject_install
%{python_expand mkdir -p %{buildroot}%{_docdir}/%{$python_prefix}-psutil
@@ -66,19 +81,28 @@ find %{buildroot}%{_docdir}/%{$python_prefix}-psutil/scripts/ -type f -name "*.p
%fdupes %{buildroot}%{_docdir}/%{$python_prefix}-psutil/
%fdupes %{buildroot}%{$python_sitearch}
}
%endif
%if %{with test}
%check
export LANG=en_US.UTF-8
export PSUTIL_TESTING=1
export PSUTIL_DEBUG=1
export PYTHONDONTRWRITEBYTECODE=1
mkdir testd
pushd testd
%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -Wa -m psutil.tests
popd
export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
# needs to be built with extensions to run scripts
%python_expand PYTHON=$python make build
# test_who, test_users - need running session
SKIPTEST="(test_who and Scripts) or (test_users and TestMiscAPIs)"
# test_import_all - pulls in too many dependencies
SKIPTEST="$SKIPTEST or (test_import_all and Scripts)"
# test_all - flaky
SKIPTEST="$SKIPTEST or (test_all and TestFetchAllProcesses)"
# test_multi_sockets_procs - not sure why it fails
SKIPTEST="$SKIPTEST or (test_multi_sockets_procs and TestSystemWideConnections)"
%pytest_arch -n auto --ignore=psutil/tests/test_memleaks.py --ignore=psutil/tests/test_sudo.py -k "not ($SKIPTEST)"
%endif
%if !%{with test}
%files %{python_files}
%license LICENSE
%doc CREDITS HISTORY.rst README.rst
@@ -87,4 +111,6 @@ popd
%exclude %{python_sitearch}/psutil/tests
%{python_sitearch}/psutil-%{version}.dist-info
%endif
%changelog