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

Commit

Permalink
Merge branch 'master' of https://github.com/giampaolo/psutil into gia…
Browse files Browse the repository at this point in the history
…mpaolo-master

# By Matthieu Darbois (1) and Sam Gross (1)
# Via GitHub
* 'master' of https://github.com/giampaolo/psutil:
  chore(ci): update actions (giampaolo#2417)
  Don't build with limited API for 3.13 free-threaded build (giampaolo#2402)

# Conflicts:
#	.github/workflows/build.yml
  • Loading branch information
ddelange committed May 22, 2024
2 parents 436580f + 5530985 commit f4b80b4
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 17 deletions.
46 changes: 34 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,17 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4

# see https://cibuildwheel.pypa.io/en/stable/faq/#macos-building-cpython-38-wheels-on-arm64
- name: "Install python 3.8 universal2 on macOS arm64"
if: runner.os == 'macOS' && runner.arch == 'ARM64'
uses: actions/setup-python@v5
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
with:
python-version: 3.8

- uses: actions/setup-python@v5
with:
python-version: 3.11

Expand All @@ -60,17 +70,17 @@ jobs:
if: matrix.archs == 'aarch64'

- name: Create wheels + run tests
uses: pypa/cibuildwheel@v2.17.0
uses: pypa/cibuildwheel@v2.18.0
with:
config-file: "./cibuildwheel.toml"
env:
CIBW_ARCHS: ${{ matrix.archs }}
CIBW_PRERELEASE_PYTHONS: True

- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-py3-${{ matrix.os }}-${{ startsWith(matrix.os, 'ubuntu') && 'all' || matrix.archs }}
path: wheelhouse

- uses: softprops/action-gh-release@v1
Expand Down Expand Up @@ -106,17 +116,17 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Create wheels + run tests
uses: pypa/[email protected]

- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-py2-${{ matrix.os }}
path: wheelhouse

- uses: softprops/action-gh-release@v1
Expand Down Expand Up @@ -157,24 +167,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: 'Run linters'
run: |
python3 -m pip install ruff==0.3.4 black rstcheck toml-sort sphinx
python3 -m pip install ruff==0.4.4 black rstcheck toml-sort sphinx
make lint-all
# upload weels as a single artefact
upload-wheels:
needs: [py2, py3]
runs-on: ubuntu-latest
steps:
- uses: actions/upload-artifact/merge@v4
with:
name: wheels
pattern: wheels-*
separate-directories: false
delete-merged: true

# Check sanity of .tar.gz + wheel files
check-dist:
needs: [py2, py3]
needs: [upload-wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: wheels
path: wheelhouse
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
# install python
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand Down
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
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.
- 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.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ PY3_DEPS = \
pypinfo \
requests \
rstcheck \
ruff==0.3.4 \
ruff==0.4.4 \
setuptools \
sphinx_rtd_theme \
teyit \
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ spaces_indent_inline_array = 4
trailing_comma_inline_array = true

[tool.cibuildwheel]
skip = ["*-musllinux*", "pp*"]
skip = [
"*-musllinux*",
"cp313-win*", # pywin32 is not available on cp313 yet
"pp*",
]
test-command = [
"env PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 PSUTIL_SCRIPTS_DIR={project}/scripts python {project}/psutil/tests/runner.py",
"env PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 PSUTIL_SCRIPTS_DIR={project}/scripts python {project}/psutil/tests/test_memleaks.py",
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import struct
import subprocess
import sys
import sysconfig
import tempfile
import warnings

Expand Down Expand Up @@ -65,6 +66,7 @@
PY37_PLUS = sys.version_info[:2] >= (3, 7)
CP36_PLUS = PY36_PLUS and sys.implementation.name == "cpython"
CP37_PLUS = PY37_PLUS and sys.implementation.name == "cpython"
Py_GIL_DISABLED = sysconfig.get_config_var("Py_GIL_DISABLED")

macros = []
if POSIX:
Expand Down Expand Up @@ -118,10 +120,10 @@ def get_version():

# Py_LIMITED_API lets us create a single wheel which works with multiple
# python versions, including unreleased ones.
if bdist_wheel and CP36_PLUS and (MACOS or LINUX):
if bdist_wheel and CP36_PLUS and (MACOS or LINUX) and not Py_GIL_DISABLED:
py_limited_api = {"py_limited_api": True}
macros.append(('Py_LIMITED_API', '0x03060000'))
elif bdist_wheel and CP37_PLUS and WINDOWS:
elif bdist_wheel and CP37_PLUS and WINDOWS and not Py_GIL_DISABLED:
# PyErr_SetFromWindowsErr / PyErr_SetFromWindowsErrWithFilename are
# part of the stable API/ABI starting with CPython 3.7
py_limited_api = {"py_limited_api": True}
Expand Down

0 comments on commit f4b80b4

Please sign in to comment.