Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/giampaolo/psutil:
  pre-release
  give CREDIT to @JeremyGrosser and @getsentry for sponsorship (thanks\!)
  fix error in test_contracts.py on win
  chore: update GHA workflows (giampaolo#2315)
  fix giampaolo#2195 / linux: no longer print exception at import time
  Add ruff Python linter, remove flake8 (giampaolo#2312)
  Add toml-sort linting tool for pyproject.toml (giampaolo#2311)
  new RTD config
  new RTD config
  new RTD config
  Fix giampaolo#2308, OpenBSD: Process.threads() always fail with AccessDenied.
  Win: fix OpenProcess not recognizing when proc is gone.
  refact assertProcessGone
  refact assertProcessGone
  Add RsT linter (giampaolo#2292)
  Make _raise_if_pid_reused() raise NSP only if pid has been reused.
  fix DEVGUIDE.rst
  PID reusage is not checked for different set methods (giampaolo#2291)
  • Loading branch information
ddelange committed Oct 16, 2023
2 parents a9041b2 + 8eb2930 commit e6e50c1
Show file tree
Hide file tree
Showing 83 changed files with 786 additions and 737 deletions.
34 changes: 0 additions & 34 deletions .flake8

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/bsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
freebsd:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run tests
uses: vmactions/freebsd-vm@v0
with:
Expand All @@ -30,7 +30,7 @@ jobs:
openbsd:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run tests
uses: vmactions/openbsd-vm@v0
with:
Expand All @@ -48,7 +48,7 @@ jobs:
netbsd:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run tests
uses: vmactions/netbsd-vm@v0
with:
Expand Down
32 changes: 10 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# * 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

on:
pull_request:
Expand All @@ -21,6 +20,9 @@ on:
permissions:
contents: write
name: build
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:
tag:
# additionally create a release for every commit to master
Expand All @@ -47,12 +49,7 @@ jobs:
- {os: windows-2019, archs: "AMD64 x86"}

steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
Expand All @@ -62,7 +59,7 @@ jobs:
if: matrix.archs == 'aarch64'

- name: Create wheels + run tests
uses: pypa/cibuildwheel@v2.11.2
uses: pypa/cibuildwheel@v2.16.2
with:
config-file: "./cibuildwheel.toml"
env:
Expand Down Expand Up @@ -107,12 +104,7 @@ jobs:
CIBW_BUILD: 'cp27-*'

steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
Expand Down Expand Up @@ -163,25 +155,21 @@ jobs:
linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: 'Run linters'
run: |
# py3
python3 -m pip install flake8 isort
python3 -m flake8 .
python3 -m isort .
# clinter
find . -type f \( -iname "*.c" -o -iname "*.h" \) | xargs python3 scripts/internal/clinter.py
python3 -m pip install ruff rstcheck toml-sort sphinx
make lint-all
# Check sanity of .tar.gz + wheel files
check-dist:
needs: [py2, py3]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/issues.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""
Bot triggered by Github Actions every time a new issue, PR or comment
"""Bot triggered by Github Actions every time a new issue, PR or comment
is created. Assign labels, provide replies, closes issues, etc. depending
on the situation.
"""
Expand Down Expand Up @@ -144,10 +143,7 @@ def has_label(issue, label):

def has_os_label(issue):
labels = set([x.name for x in issue.labels])
for label in OS_LABELS:
if label in labels:
return True
return False
return any(x in labels for x in OS_LABELS)


def get_repo():
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# install python
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
with:
Expand Down
52 changes: 32 additions & 20 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
*Bug tracker at https://github.com/giampaolo/psutil/issues*

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

XXXX-XX-XX
2023-10-15

**Enhancements**

Expand All @@ -15,24 +15,38 @@ XXXX-XX-XX
- 2266_: if `Process`_ class is passed a very high PID, raise `NoSuchProcess`_
instead of OverflowError. (patch by Xuehai Pan)
- 2246_: drop python 3.4 & 3.5 support. (patch by Matthieu Darbois)
- 2290_: PID reuse is now pre-emptively checked for `Process.ppid()`_ and
`Process.parents()`_.
- 2312_: use ``ruff`` Python linter instead of ``flake8 + isort``. It's an
order of magnitude faster + it adds a ton of new code quality checks.

**Bug fixes**

- 2195_, [Linux]: no longer print exception at import time in case /proc/stat
can't be read due to permission error. Redirect it to ``PSUTIL_DEBUG``
instead.
- 2241_, [NetBSD]: can't compile On NetBSD 10.99.3/amd64. (patch by Thomas
Klausner)
- 2245_, [Windows]: fix var unbound error on possibly in `swap_memory()`_
(patch by student_2333)
- 2268_: ``bytes2human()`` utility function was unable to properly represent
negative values.
- 2252_, [Windows]: `psutil.disk_usage`_ fails on Python 3.12+. (patch by
- 2252_, [Windows]: `disk_usage()`_ fails on Python 3.12+. (patch by
Matthieu Darbois)
- 2284_, [Linux]: `memory_full_info`_ may incorrectly raise `ZombieProcess`_
if it's determined via ``/proc/pid/smaps_rollup``. Instead we now fallback on
reading ``/proc/pid/smaps``.
- 2284_, [Linux]: `Process.memory_full_info()`_ may incorrectly raise
`ZombieProcess`_ if it's determined via ``/proc/pid/smaps_rollup``. Instead
we now fallback on reading ``/proc/pid/smaps``.
- 2287_, [OpenBSD], [NetBSD]: `Process.is_running()`_ erroneously return
``False`` for zombie processes, because creation time cannot be determined.
- 2288_, [Linux]: correctly raise `ZombieProcess`_ on `exe`_, `cmdline`_ and
`memory_maps`_ instead of returning a "null" value.
- 2288_, [Linux]: correctly raise `ZombieProcess`_ on `Process.exe()`_,
`Process.cmdline()`_ and `Process.memory_maps()`_ instead of returning a
"null" value.
- 2290_: differently from what stated in the doc, PID reuse is not
pre-emptively checked for `Process.nice()`_ (set), `Process.ionice()`_,
(set), `Process.cpu_affinity()`_ (set), `Process.rlimit()`_
(set), `Process.parent()`_.
- 2308_, [OpenBSD]: `Process.threads()`_ always fail with AccessDenied (also as
root).

5.9.5
=====
Expand All @@ -45,10 +59,10 @@ XXXX-XX-XX
`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:
- 2230_, [OpenBSD]: `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)
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
Expand All @@ -64,7 +78,7 @@ XXXX-XX-XX

**Bug fixes**

- 1043_, [OpenBSD] `psutil.net_connections`_ returns duplicate entries.
- 1043_, [OpenBSD] `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 Down Expand Up @@ -122,7 +136,7 @@ XXXX-XX-XX

**Bug fixes**

- 2116_, [macOS], [critical]: `psutil.net_connections`_ fails with RuntimeError.
- 2116_, [macOS], [critical]: `net_connections()`_ fails with RuntimeError.
- 2135_, [macOS]: `Process.environ()`_ may contain garbage data. Fix
out-of-bounds read around ``sysctl_procargs``. (patch by Bernhard Urban-Forster)
- 2138_, [Linux], **[critical]**: can't compile psutil on Android due to
Expand Down Expand Up @@ -1569,7 +1583,7 @@ XXXX-XX-XX
- 564_: C extension version mismatch in case the user messed up with psutil
installation or with sys.path is now detected at import time.
- 568_: new `pidof.py`_ script.
- 569_, [FreeBSD]: add support for `Process.cpu_affinity`_ on FreeBSD.
- 569_, [FreeBSD]: add support for `Process.cpu_affinity()`_ on FreeBSD.

**Bug fixes**

Expand All @@ -1581,7 +1595,7 @@ XXXX-XX-XX
(patch by spacewander)
- 565_, [Windows]: use proper encoding for `Process.username()`_ and `users()`_.
(patch by Sylvain Mouquet)
- 567_, [Linux]: in the alternative implementation of `Process.cpu_affinity`_
- 567_, [Linux]: in the alternative implementation of `Process.cpu_affinity()`_
``PyList_Append`` and ``Py_BuildValue`` return values are not checked.
- 569_, [FreeBSD]: fix memory leak in `cpu_count()`_ with ``logical=False``.
- 571_, [Linux]: `Process.open_files()`_ might swallow `AccessDenied`_
Expand Down Expand Up @@ -2163,7 +2177,8 @@ In most cases accessing the old names will work but it will cause a
representation.
- 283_: speedup `Process.is_running()`_ by caching its return value in case the
process is terminated.
- 284_, [POSIX]: per-process number of opened file descriptors (`Process.num_fds`_).
- 284_, [POSIX]: per-process number of opened file descriptors
(`Process.num_fds()`_).
- 287_: `process_iter()`_ now caches `Process`_ instances between calls.
- 290_: `Process.nice()`_ property is deprecated in favor of new ``get_nice()``
and ``set_nice()`` methods.
Expand Down Expand Up @@ -2521,8 +2536,6 @@ In most cases accessing the old names will work but it will cause a

.. _`Process`: https://psutil.readthedocs.io/en/latest/#psutil.Process
.. _`psutil.Popen`: https://psutil.readthedocs.io/en/latest/#psutil.Popen
.. _`psutil.Process`: https://psutil.readthedocs.io/en/latest/#psutil.Process


.. _`AccessDenied`: https://psutil.readthedocs.io/en/latest/#psutil.AccessDenied
.. _`NoSuchProcess`: https://psutil.readthedocs.io/en/latest/#psutil.NoSuchProcess
Expand Down Expand Up @@ -2580,7 +2593,6 @@ In most cases accessing the old names will work but it will cause a
.. _`cpu_distribution.py`: https://github.com/giampaolo/psutil/blob/master/scripts/cpu_distribution.py
.. _`disk_usage.py`: https://github.com/giampaolo/psutil/blob/master/scripts/disk_usage.py
.. _`free.py`: https://github.com/giampaolo/psutil/blob/master/scripts/free.py
.. _`ifconfig.py`: https://github.com/giampaolo/psutil/blob/master/scripts/ifconfig.py
.. _`iotop.py`: https://github.com/giampaolo/psutil/blob/master/scripts/iotop.py
.. _`meminfo.py`: https://github.com/giampaolo/psutil/blob/master/scripts/meminfo.py
.. _`netstat.py`: https://github.com/giampaolo/psutil/blob/master/scripts/netstat.py
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include .flake8
include .gitignore
include CONTRIBUTING.md
include CREDITS
Expand All @@ -8,6 +7,7 @@ include LICENSE
include MANIFEST.in
include Makefile
include README.rst
include docs/.readthedocs.yaml
include docs/DEVGUIDE.rst
include docs/DEVNOTES
include docs/Makefile
Expand All @@ -19,6 +19,7 @@ include docs/_static/sidebar.js
include docs/conf.py
include docs/index.rst
include docs/make.bat
include docs/requirements.txt
include make.bat
include psutil/__init__.py
include psutil/_common.py
Expand Down
Loading

0 comments on commit e6e50c1

Please sign in to comment.