Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sujaldev committed May 28, 2023
2 parents 3d2aa88 + 49aba75 commit d4b988b
Show file tree
Hide file tree
Showing 96 changed files with 6,128 additions and 5,628 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/bsd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Execute tests on *BSD platforms. Does not produce wheels.
# Useful URLs:
# https://github.com/vmactions/freebsd-vm
# https://github.com/vmactions/openbsd-vm
# https://github.com/vmactions/netbsd-vm

on: [push, pull_request]
name: bsd-tests
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.sha || '' }}
cancel-in-progress: true
jobs:
freebsd:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Run tests
uses: vmactions/freebsd-vm@v0
with:
usesh: true
prepare: |
pkg install -y gcc python3
run: |
set -e -x
make install-pip
python3 -m pip install --user setuptools
make install
make test
make test-memleaks
openbsd:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Run tests
uses: vmactions/openbsd-vm@v0
with:
usesh: true
prepare: |
set -e
pkg_add gcc python3
run: |
set -e
make install-pip
python3 -m pip install --user setuptools
make install
make test
make test-memleaks
netbsd:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Run tests
uses: vmactions/netbsd-vm@v0
with:
usesh: true
prepare: |
set -e
pkg_add -v pkgin
pkgin update
pkgin -y install python311-* py311-setuptools-* gcc12-*
run: |
set -e
make install-pip PYTHON=python3.11
python3.11 -m pip install --user setuptools
make install PYTHON=python3.11
make test PYTHON=python3.11
make test-memleaks PYTHON=python3.11
45 changes: 6 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
# Executed on every push by GitHub Actions. This runs CI tests and
# generates wheels (not all) on the following platforms:
# Runs CI tests and generates wheels on the following platforms:
#
# * Linux
# * macOS
# * Windows (disabled)
# * FreeBSD
# * Linux (py2 and py3)
# * macOS (py2 and py3)
# * Windows (py3, py2 is done by appveyor)
#
# To skip certain builds see:
# https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
#
# External GH actions:
# Useful URLs:
# * https://github.com/pypa/cibuildwheel
# * https://github.com/actions/checkout
# * https://github.com/actions/setup-python
# * https://github.com/actions/upload-artifact
# * https://github.com/marketplace/actions/cancel-workflow-action
# * https://github.com/vmactions/freebsd-vm

on: [push, pull_request]
name: build
Expand Down Expand Up @@ -110,34 +104,6 @@ jobs:
python setup.py sdist
mv dist/psutil*.tar.gz wheelhouse/
# FreeBSD (tests only)
py3-freebsd:
runs-on: macos-12
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3

- name: Run tests
id: test
uses: vmactions/freebsd-vm@v0
with:
usesh: true
prepare: pkg install -y gcc python3
run: |
set +e
export \
PYTHONUNBUFFERED=1 \
PYTHONWARNINGS=always \
PSUTIL_DEBUG=1
python3 -m pip install --user setuptools
python3 setup.py install
python3 psutil/tests/runner.py
python3 psutil/tests/test_memleaks.py
# Run linters
linters:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -169,3 +135,4 @@ jobs:
- run: |
python scripts/internal/print_hashes.py wheelhouse/
pipx run twine check --strict wheelhouse/*
pipx run abi3audit --verbose --strict wheelhouse/*-abi3-*.whl
2 changes: 1 addition & 1 deletion .github/workflows/issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"wsl": ["wsl"],
"unix": [
"psposix", "_psutil_posix", "waitpid", "statvfs", "/dev/tty",
"/dev/pts",
"/dev/pts", "posix",
],
"pypy": ["pypy"],
# types
Expand Down
4 changes: 2 additions & 2 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ I: 18
N: Thomas Klausner
W: https://github.com/0-wiz-0
D: NetBSD implementation (co-author).
I: 557, 2128
I: 557, 2128, 2241

N: Ryo Onodera
W: https://github.com/ryoon
Expand Down Expand Up @@ -804,7 +804,7 @@ I: 2150

N: Daniel Widdis
W: https://github.com/dbwiddis
I: 2077
I: 2077, 2160

N: Amir Rossert
W: https://github.com/arossert
Expand Down
44 changes: 42 additions & 2 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@
*Bug tracker at https://github.com/giampaolo/psutil/issues*

5.9.5 (IN DEVELOPMENT)
5.9.6 (IN DEVELOPMENT)
======================

XXXX-XX-XX

- 2241_, [NetBSD]: can't compile On NetBSD 10.99.3/amd64. (patch by Thomas
Klausner)

5.9.5
=====

2023-04-17

**Enhancements**

- 2196_: in case of exception, display a cleaner error traceback by hiding the
`KeyError` bit deriving from a missed cache hit.
- 2217_: print the full traceback when a `DeprecationWarning` or `UserWarning`
is raised.
- 2230_, [OpenBSD]: `psutil.net_connections`_ implementation was rewritten from
scratch:
- We're now able to retrieve the path of AF_UNIX sockets (before it was an
empty string)
- The function is faster since it no longer iterates over all processes.
- No longer produces duplicate connection entries.
- 2238_: there are cases where `Process.cwd()`_ cannot be determined
(e.g. directory no longer exists), in which case we returned either ``None``
or an empty string. This was consolidated and we now return ``""`` on all
platforms.
- 2239_, [UNIX]: if process is a zombie, and we can only determine part of the
its truncated `Process.name()`_ (15 chars), don't fail with `ZombieProcess`_
when we try to guess the full name from the `Process.cmdline()`_. Just
return the truncated name.
- 2240_, [NetBSD], [OpenBSD]: add CI testing on every commit for NetBSD and
OpenBSD platforms (python 3 only).

**Bug fixes**

- 1043_, [OpenBSD] `psutil.net_connections`_ returns duplicate entries.
- 1915_, [Linux]: on certain kernels, ``"MemAvailable"`` field from
``/proc/meminfo`` returns ``0`` (possibly a kernel bug), in which case we
calculate an approximation for ``available`` memory which matches "free"
Expand All @@ -25,6 +52,17 @@
Matthieu Darbois)
- 2219_, [Linux] battery detection in `psutil.sensors_battery()` relies on an
assumption which is not true of all systems (patch by Sujal Singh).
- 2225_, [POSIX]: `users()`_ loses precision for ``started`` attribute (off by
1 minute).
- 2229_, [OpenBSD]: unable to properly recognize zombie processes.
`NoSuchProcess`_ may be raised instead of `ZombieProcess`_.
- 2231_, [NetBSD]: *available* `virtual_memory()`_ is higher than *total*.
- 2234_, [NetBSD]: `virtual_memory()`_ metrics are wrong: *available* and
*used* are too high. We now match values shown by *htop* CLI utility.
- 2236_, [NetBSD]: `Process.num_threads()`_ and `Process.threads()`_ return
threads that are already terminated.
- 2237_, [OpenBSD], [NetBSD]: `Process.cwd()`_ may raise ``FileNotFoundError``
if cwd no longer exists. Return an empty string instead.

5.9.4
=====
Expand All @@ -45,6 +83,8 @@
``SPEED_UNKNOWN`` definition. (patch by Amir Rossert)
- 2010_, [macOS]: on MacOS, arm64 ``IFM_1000_TX`` and ``IFM_1000_T`` are the
same value, causing a build failure. (patch by Lawrence D'Anna)
- 2160_, [Windows]: Get Windows percent swap usage from performance counters.
(patch by Daniel Widdis)

5.9.3
=====
Expand Down Expand Up @@ -443,7 +483,7 @@
doesn't exist. (patch by Cedric Lamoriniere)
- 1471_, [SunOS]: `Process.name()`_ and `Process.cmdline()`_ can return
``SystemError``. (patch by Daniel Beer)
- 1472_, [Linux]: `cpu_freq()`_ does not return all CPUs on Rasbperry-pi 3.
- 1472_, [Linux]: `cpu_freq()`_ does not return all CPUs on Raspberry-pi 3.
- 1474_: fix formatting of ``psutil.tests()`` which mimics ``ps aux`` output.
- 1475_, [Windows], **[critical]**: ``OSError.winerror`` attribute wasn't
properly checked resulting in ``WindowsError(ERROR_ACCESS_DENIED)`` being
Expand Down
10 changes: 6 additions & 4 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,20 @@ OpenBSD
::

export PKG_PATH=http://ftp.eu.openbsd.org/pub/OpenBSD/`uname -r`/packages/`uname -m`/
pkg_add -v python gcc
pkg_add -v python3 gcc
pip install psutil

NetBSD
------

Assuming Python 3.11 (the most recent at the time of writing):

::

export PKG_PATH="ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/`uname -m`/`uname -r`/All"
export PKG_PATH="http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/`uname -m`/`uname -r`/All"
pkg_add -v pkgin
pkgin install python3 gcc
pip install psutil
pkgin install python311-* gcc12-* py311-setuptools-* py311-pip-*
python3.11 -m pip install psutil

Sun Solaris
-----------
Expand Down
56 changes: 46 additions & 10 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ include psutil/arch/aix/ifaddrs.h
include psutil/arch/aix/net_connections.c
include psutil/arch/aix/net_connections.h
include psutil/arch/aix/net_kernel_structs.h
include psutil/arch/bsd/cpu.c
include psutil/arch/bsd/cpu.h
include psutil/arch/bsd/disk.c
include psutil/arch/bsd/disk.h
include psutil/arch/bsd/net.c
include psutil/arch/bsd/net.h
include psutil/arch/bsd/proc.c
include psutil/arch/bsd/proc.h
include psutil/arch/bsd/sys.c
include psutil/arch/bsd/sys.h
include psutil/arch/freebsd/cpu.c
include psutil/arch/freebsd/cpu.h
include psutil/arch/freebsd/disk.c
Expand All @@ -61,10 +71,16 @@ include psutil/arch/freebsd/sensors.c
include psutil/arch/freebsd/sensors.h
include psutil/arch/freebsd/sys_socks.c
include psutil/arch/freebsd/sys_socks.h
include psutil/arch/netbsd/cpu.c
include psutil/arch/netbsd/cpu.h
include psutil/arch/netbsd/disk.c
include psutil/arch/netbsd/disk.h
include psutil/arch/netbsd/mem.c
include psutil/arch/netbsd/mem.h
include psutil/arch/netbsd/proc.c
include psutil/arch/netbsd/proc.h
include psutil/arch/netbsd/socks.c
include psutil/arch/netbsd/socks.h
include psutil/arch/netbsd/specific.c
include psutil/arch/netbsd/specific.h
include psutil/arch/openbsd/cpu.c
include psutil/arch/openbsd/cpu.h
include psutil/arch/openbsd/disk.c
Expand All @@ -73,10 +89,22 @@ include psutil/arch/openbsd/mem.c
include psutil/arch/openbsd/mem.h
include psutil/arch/openbsd/proc.c
include psutil/arch/openbsd/proc.h
include psutil/arch/openbsd/socks.c
include psutil/arch/openbsd/socks.h
include psutil/arch/osx/cpu.c
include psutil/arch/osx/cpu.h
include psutil/arch/osx/process_info.c
include psutil/arch/osx/process_info.h
include psutil/arch/osx/disk.c
include psutil/arch/osx/disk.h
include psutil/arch/osx/mem.c
include psutil/arch/osx/mem.h
include psutil/arch/osx/net.c
include psutil/arch/osx/net.h
include psutil/arch/osx/proc.c
include psutil/arch/osx/proc.h
include psutil/arch/osx/sensors.c
include psutil/arch/osx/sensors.h
include psutil/arch/osx/sys.c
include psutil/arch/osx/sys.h
include psutil/arch/solaris/environ.c
include psutil/arch/solaris/environ.h
include psutil/arch/solaris/v10/ifaddrs.c
Expand All @@ -85,21 +113,29 @@ include psutil/arch/windows/cpu.c
include psutil/arch/windows/cpu.h
include psutil/arch/windows/disk.c
include psutil/arch/windows/disk.h
include psutil/arch/windows/mem.c
include psutil/arch/windows/mem.h
include psutil/arch/windows/net.c
include psutil/arch/windows/net.h
include psutil/arch/windows/ntextapi.h
include psutil/arch/windows/process_handles.c
include psutil/arch/windows/process_handles.h
include psutil/arch/windows/process_info.c
include psutil/arch/windows/process_info.h
include psutil/arch/windows/process_utils.c
include psutil/arch/windows/process_utils.h
include psutil/arch/windows/proc.c
include psutil/arch/windows/proc.h
include psutil/arch/windows/proc_handles.c
include psutil/arch/windows/proc_handles.h
include psutil/arch/windows/proc_info.c
include psutil/arch/windows/proc_info.h
include psutil/arch/windows/proc_utils.c
include psutil/arch/windows/proc_utils.h
include psutil/arch/windows/security.c
include psutil/arch/windows/security.h
include psutil/arch/windows/sensors.c
include psutil/arch/windows/sensors.h
include psutil/arch/windows/services.c
include psutil/arch/windows/services.h
include psutil/arch/windows/socks.c
include psutil/arch/windows/socks.h
include psutil/arch/windows/sys.c
include psutil/arch/windows/sys.h
include psutil/arch/windows/wmi.c
include psutil/arch/windows/wmi.h
include psutil/tests/README.rst
Expand Down

0 comments on commit d4b988b

Please sign in to comment.