forked from pool/python-psutil
Compare commits
19 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 90373e07b4 | |||
| 30b028cc03 | |||
| c9dc6de0d6 | |||
| 4c6fbf6cad | |||
| 5c3f702da8 | |||
| d5fad8f15a | |||
| d5ab93a32f | |||
| 720ab2104b | |||
| 4a6e40f617 | |||
| 35319d6bb8 | |||
| a045c642a1 | |||
| 12ad701e10 | |||
| 61779a7ac4 | |||
| 1f1ab5ab06 | |||
| 90fecc6fc9 | |||
| ba4f9f0f52 | |||
| 0fba780c66 | |||
| d7f03b8b1e | |||
| e65b1b1f7d |
3
_multibuild
Normal file
3
_multibuild
Normal file
@@ -0,0 +1,3 @@
|
||||
<multibuild>
|
||||
<package>test</package>
|
||||
</multibuild>
|
||||
@@ -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.
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3f02134e82cfb5d089fddf20bb2e03fd5cd52395321d1c8458a9e58500ff417c
|
||||
size 498429
|
||||
3
psutil-7.1.3.tar.gz
Normal file
3
psutil-7.1.3.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6c86281738d77335af7aec228328e944b30930899ea760ecf33a4dba66be5e74
|
||||
size 489059
|
||||
52
pytest9.patch
Normal file
52
pytest9.patch
Normal 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
|
||||
@@ -1,3 +1,221 @@
|
||||
-------------------------------------------------------------------
|
||||
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>
|
||||
|
||||
- update to 7.0.0:
|
||||
* 669_, [Windows]: `net_if_addrs()`_ also returns the broadcast
|
||||
address instead of None.
|
||||
* 2480_: Python 2.7 is no longer supported. Latest version
|
||||
supporting Python 2.7 is psutil 6.1.X. Install it with: pip2
|
||||
install psutil==6.1.*.
|
||||
* 2490_: removed long deprecated Process.memory_info_ex()
|
||||
method. It was deprecated in psutil 4.0.0, released 8 years
|
||||
ago. Substitute is Process.memory_full_info().
|
||||
* 2496_, [Linux]: Avoid segfault (a cPython bug) on
|
||||
Process.memory_maps() for processes that use hundreds of GBs
|
||||
of memory.
|
||||
* 2502_, [macOS]: `virtual_memory()`_ now relies on
|
||||
host_statistics64 instead of host_statistics. This is the
|
||||
same approach used by vm_stat CLI tool, and should grant more
|
||||
accurate results.
|
||||
* 2480_: Python 2.7 is no longer supported.
|
||||
* 2490_: removed long deprecated Process.memory_info_ex()
|
||||
method.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jan 6 11:25:18 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
|
||||
|
||||
- Update to 6.1.1
|
||||
* 2471_: use Vulture CLI tool to detect dead code.
|
||||
* 2418_, [Linux]: fix race condition in case /proc/PID/stat does not exist, but
|
||||
/proc/PID does, resulting in FileNotFoundError.
|
||||
* 2470_, [Linux]: `users()`_ may return "localhost" instead of the actual IP
|
||||
address of the user logged in.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 20 16:23:16 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- 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 <adrian.glaubitz@suse.com>
|
||||
|
||||
- Update to version 6.0.0
|
||||
* 2109_: ``maxfile`` and ``maxpath`` fields were removed from the namedtuple
|
||||
returned by `disk_partitions()`_. Reason: on network filesystems (NFS) this
|
||||
can potentially take a very long time to complete.
|
||||
* 2366_, [Windows]: log debug message when using slower process APIs.
|
||||
* 2375_, [macOS]: provide arm64 wheels. (patch by Matthieu Darbois)
|
||||
* 2396_: `process_iter()`_ no longer pre-emptively checks whether PIDs have
|
||||
been reused. This makes `process_iter()`_ around 20x times faster.
|
||||
* 2396_: a new ``psutil.process_iter.cache_clear()`` API can be used the clear
|
||||
`process_iter()`_ internal cache.
|
||||
* 2401_, Support building with free-threaded CPython 3.13. (patch by Sam Gross)
|
||||
* 2407_: `Process.connections()`_ was renamed to `Process.net_connections()`_.
|
||||
The old name is still available, but it's deprecated (triggers a
|
||||
``DeprecationWarning``) and will be removed in the future.
|
||||
* 2425_: [Linux]: provide aarch64 wheels. (patch by Matthieu Darbois / Ben Raz)
|
||||
* 2250_, [NetBSD]: `Process.cmdline()`_ sometimes fail with EBUSY. It usually
|
||||
happens for long cmdlines with lots of arguments. In this case retry getting
|
||||
the cmdline for up to 50 times, and return an empty list as last resort.
|
||||
* 2254_, [Linux]: offline cpus raise NotImplementedError in cpu_freq() (patch
|
||||
by Shade Gladden)
|
||||
* 2272_: Add pickle support to psutil Exceptions.
|
||||
* 2359_, [Windows], [CRITICAL]: `pid_exists()`_ disagrees with `Process`_ on
|
||||
whether a pid exists when ERROR_ACCESS_DENIED.
|
||||
* 2360_, [macOS]: can't compile on macOS < 10.13. (patch by Ryan Schmidt)
|
||||
* 2362_, [macOS]: can't compile on macOS 10.11. (patch by Ryan Schmidt)
|
||||
* 2365_, [macOS]: can't compile on macOS < 10.9. (patch by Ryan Schmidt)
|
||||
* 2395_, [OpenBSD]: `pid_exists()`_ erroneously return True if the argument is
|
||||
a thread ID (TID) instead of a PID (process ID).
|
||||
* 2412_, [macOS]: can't compile on macOS 10.4 PowerPC due to missing `MNT_`
|
||||
constants.
|
||||
* 2109_: the namedtuple returned by `disk_partitions()`_' no longer has
|
||||
``maxfile`` and ``maxpath`` fields.
|
||||
* 2396_: `process_iter()`_ no longer pre-emptively checks whether PIDs have
|
||||
been reused. If you want to check for PID reusage you are supposed to use
|
||||
`Process.is_running()`_ against the yielded `Process`_ instances. That will
|
||||
also automatically remove reused PIDs from `process_iter()`_ internal cache.
|
||||
* 2407_: `Process.connections()`_ was renamed to `Process.net_connections()`_.
|
||||
The old name is still available, but it's deprecated (triggers a
|
||||
``DeprecationWarning``) and will be removed in the future.
|
||||
- from version 5.9.8
|
||||
* 2343_, [FreeBSD]: filter `net_connections()`_ returned list in C instead of
|
||||
Python, and avoid to retrieve unnecessary connection types unless explicitly
|
||||
asked. E.g., on an IDLE system with few IPv6 connections this will run around
|
||||
4 times faster. Before all connection types (TCP, UDP, UNIX) were retrieved
|
||||
internally, even if only a portion was returned.
|
||||
* 2342_, [NetBSD]: same as above (#2343) but for NetBSD.
|
||||
* 2349_: adopted black formatting style.
|
||||
* 930_, [NetBSD], [critical]: `net_connections()`_ implementation was broken.
|
||||
It could either leak memory or core dump.
|
||||
* 2340_, [NetBSD]: if process is terminated, `Process.cwd()`_ will return an
|
||||
empty string instead of raising `NoSuchProcess`_.
|
||||
* 2345_, [Linux]: fix compilation on older compiler missing DUPLEX_UNKNOWN.
|
||||
* 2222_, [macOS]: `cpu_freq()` now returns fixed values for `min` and `max`
|
||||
frequencies in all Apple Silicon chips.
|
||||
- Drop obsolete patch to skip tests on Python 2
|
||||
* skip_rlimit_tests_on_python2.patch
|
||||
- Update patch to skip failing tests for new version
|
||||
* skip_failing_tests.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 22 10:40:19 UTC 2024 - Fabian Vogt <fvogt@suse.com>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-psutil
|
||||
#
|
||||
# Copyright (c) 2024 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,26 +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: 5.9.7
|
||||
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-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 skip_rlimit_tests_on_python2.patch alarrosa@suse.com
|
||||
Patch3: skip_rlimit_tests_on_python2.patch
|
||||
# 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}
|
||||
@@ -48,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}
|
||||
BuildRequires: %{python_module pytest-xdist}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: net-tools
|
||||
BuildRequires: procps
|
||||
%endif
|
||||
%python_subpackages
|
||||
|
||||
@@ -58,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
|
||||
@@ -71,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
|
||||
@@ -92,4 +111,6 @@ popd
|
||||
%exclude %{python_sitearch}/psutil/tests
|
||||
%{python_sitearch}/psutil-%{version}.dist-info
|
||||
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
Index: psutil-5.9.5/psutil/tests/test_misc.py
|
||||
===================================================================
|
||||
--- psutil-5.9.5.orig/psutil/tests/test_misc.py
|
||||
+++ psutil-5.9.5/psutil/tests/test_misc.py
|
||||
@@ -251,6 +251,7 @@ class TestMisc(PsutilTestCase):
|
||||
|
||||
# # 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):
|
||||
@@ -847,6 +848,7 @@ class TestScripts(PsutilTestCase):
|
||||
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)
|
||||
@@ -866,6 +868,7 @@ class TestScripts(PsutilTestCase):
|
||||
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')
|
||||
|
||||
Index: psutil-5.9.5/psutil/tests/test_linux.py
|
||||
===================================================================
|
||||
--- psutil-5.9.5.orig/psutil/tests/test_linux.py
|
||||
+++ psutil-5.9.5/psutil/tests/test_linux.py
|
||||
@@ -713,6 +713,7 @@ class TestSystemCPUCountLogical(PsutilTe
|
||||
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('#')])
|
||||
@@ -756,6 +757,7 @@ class TestSystemCPUCountLogical(PsutilTe
|
||||
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()
|
||||
@@ -1134,6 +1136,7 @@ class TestSystemDiskPartitions(PsutilTes
|
||||
|
||||
@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"
|
||||
@@ -1308,6 +1311,7 @@ class TestSystemDiskIoCounters(PsutilTes
|
||||
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):
|
||||
if path == '/proc/diskstats':
|
||||
@@ -1351,6 +1355,7 @@ class TestRootFsDeviceFinder(PsutilTestC
|
||||
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())
|
||||
@@ -1378,6 +1383,7 @@ class TestRootFsDeviceFinder(PsutilTestC
|
||||
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',
|
||||
@@ -1676,6 +1682,8 @@ class TestSensorsBattery(PsutilTestCase)
|
||||
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(
|
||||
@@ -1683,6 +1691,8 @@ class TestSensorsBattery(PsutilTestCase)
|
||||
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.
|
||||
@@ -2275,6 +2285,7 @@ class TestProcessAgainstStatus(PsutilTes
|
||||
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):
|
||||
Index: psutil-5.9.5/psutil/tests/test_posix.py
|
||||
===================================================================
|
||||
--- psutil-5.9.5.orig/psutil/tests/test_posix.py
|
||||
+++ psutil-5.9.5/psutil/tests/test_posix.py
|
||||
@@ -413,6 +413,7 @@ class TestSystemAPIs(PsutilTestCase):
|
||||
# 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:
|
||||
Index: psutil-5.9.5/psutil/tests/test_system.py
|
||||
===================================================================
|
||||
--- psutil-5.9.5.orig/psutil/tests/test_system.py
|
||||
+++ psutil-5.9.5/psutil/tests/test_system.py
|
||||
@@ -201,6 +201,7 @@ class TestMiscAPIs(PsutilTestCase):
|
||||
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, [])
|
||||
@@ -586,6 +587,7 @@ class TestDiskAPIs(PsutilTestCase):
|
||||
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)
|
||||
Index: psutil-5.9.5/psutil/tests/test_contracts.py
|
||||
===================================================================
|
||||
--- psutil-5.9.5.orig/psutil/tests/test_contracts.py
|
||||
+++ psutil-5.9.5/psutil/tests/test_contracts.py
|
||||
@@ -251,6 +251,7 @@ class TestSystemAPITypes(PsutilTestCase)
|
||||
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():
|
||||
Index: psutil-5.9.5/psutil/tests/test_process.py
|
||||
===================================================================
|
||||
--- psutil-5.9.5.orig/psutil/tests/test_process.py
|
||||
+++ psutil-5.9.5/psutil/tests/test_process.py
|
||||
@@ -346,6 +346,7 @@ class TestProcess(PsutilTestCase):
|
||||
|
||||
@unittest.skipIf(not HAS_IONICE, "not supported")
|
||||
@unittest.skipIf(not LINUX, "linux only")
|
||||
+ @unittest.skip("Unreliable in OBS")
|
||||
def test_ionice_linux(self):
|
||||
p = psutil.Process()
|
||||
if not CI_TESTING:
|
||||
@@ -1,56 +0,0 @@
|
||||
---
|
||||
psutil/tests/test_process.py | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
Index: psutil-5.9.6/psutil/tests/test_process.py
|
||||
===================================================================
|
||||
--- psutil-5.9.6.orig/psutil/tests/test_process.py
|
||||
+++ psutil-5.9.6/psutil/tests/test_process.py
|
||||
@@ -419,6 +419,7 @@ class TestProcess(PsutilTestCase):
|
||||
p.ionice(init)
|
||||
|
||||
@unittest.skipIf(not HAS_RLIMIT, "not supported")
|
||||
+ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2")
|
||||
def test_rlimit_get(self):
|
||||
import resource
|
||||
p = psutil.Process(os.getpid())
|
||||
@@ -442,6 +443,7 @@ class TestProcess(PsutilTestCase):
|
||||
self.assertGreaterEqual(ret[1], -1)
|
||||
|
||||
@unittest.skipIf(not HAS_RLIMIT, "not supported")
|
||||
+ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2")
|
||||
def test_rlimit_set(self):
|
||||
p = self.spawn_psproc()
|
||||
p.rlimit(psutil.RLIMIT_NOFILE, (5, 5))
|
||||
@@ -455,6 +457,7 @@ class TestProcess(PsutilTestCase):
|
||||
p.rlimit(psutil.RLIMIT_NOFILE, (5, 5, 5))
|
||||
|
||||
@unittest.skipIf(not HAS_RLIMIT, "not supported")
|
||||
+ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2")
|
||||
def test_rlimit(self):
|
||||
p = psutil.Process()
|
||||
testfn = self.get_testfn()
|
||||
@@ -475,6 +478,7 @@ class TestProcess(PsutilTestCase):
|
||||
self.assertEqual(p.rlimit(psutil.RLIMIT_FSIZE), (soft, hard))
|
||||
|
||||
@unittest.skipIf(not HAS_RLIMIT, "not supported")
|
||||
+ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2")
|
||||
def test_rlimit_infinity(self):
|
||||
# First set a limit, then re-set it by specifying INFINITY
|
||||
# and assume we overridden the previous limit.
|
||||
@@ -490,6 +494,7 @@ class TestProcess(PsutilTestCase):
|
||||
self.assertEqual(p.rlimit(psutil.RLIMIT_FSIZE), (soft, hard))
|
||||
|
||||
@unittest.skipIf(not HAS_RLIMIT, "not supported")
|
||||
+ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2")
|
||||
def test_rlimit_infinity_value(self):
|
||||
# RLIMIT_FSIZE should be RLIM_INFINITY, which will be a really
|
||||
# big number on a platform with large file support. On these
|
||||
@@ -1303,6 +1308,7 @@ class TestProcess(PsutilTestCase):
|
||||
assert_raises_nsp(fun, name)
|
||||
|
||||
@unittest.skipIf(not POSIX, 'POSIX only')
|
||||
+ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2")
|
||||
def test_zombie_process(self):
|
||||
parent, zombie = self.spawn_zombie()
|
||||
self.assertProcessZombie(zombie)
|
||||
Reference in New Issue
Block a user