Skip to content

Commit 0f55d78

Browse files
authored
Updating CI/CD, and use Nodejs 20 (#47)
* Updating CI/CD, and use Nodejs 20 * Update some actions * Re-adding support for psutil 6.0.0 * Updated the upload-artifact from v3 to v4 * Updated readthedocs requirements * Stop making PDF build
1 parent 3b68751 commit 0f55d78

7 files changed

Lines changed: 43 additions & 41 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
Publish:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212
with:
1313
fetch-depth: 0
1414
- name: Set up Python
15-
uses: actions/setup-python@v4
15+
uses: actions/setup-python@v5
1616
with:
1717
python-version: 3.9
1818
- name: Install Nox
@@ -27,4 +27,4 @@ jobs:
2727
with:
2828
user: __token__
2929
password: ${{ secrets.PYPI_TOKEN }}
30-
print_hash: true
30+
print-hash: true

.github/workflows/testing.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ jobs:
66
Pre-Commit:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v3
9+
- uses: actions/checkout@v4
1010
- name: Set up Python
11-
uses: actions/setup-python@v4
11+
uses: actions/setup-python@v5
1212
with:
1313
python-version: 3.9
1414
- name: Set Cache Key
@@ -17,7 +17,7 @@ jobs:
1717
run: |
1818
sudo apt-get update
1919
sudo apt-get install -y libxml2 libxml2-dev libxslt-dev
20-
- uses: actions/cache@v3
20+
- uses: actions/cache@v4
2121
with:
2222
path: ~/.cache/pre-commit
2323
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
@@ -28,9 +28,9 @@ jobs:
2828
needs: Pre-Commit
2929

3030
steps:
31-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@v4
3232
- name: Setup Python
33-
uses: actions/setup-python@v4
33+
uses: actions/setup-python@v5
3434
with:
3535
python-version: 3.9
3636
- name: Install Nox
@@ -49,10 +49,10 @@ jobs:
4949
timeout-minutes: 10
5050

5151
steps:
52-
- uses: actions/checkout@v3
52+
- uses: actions/checkout@v4
5353

5454
- name: Set up Python 3.9 For Nox
55-
uses: actions/setup-python@v4
55+
uses: actions/setup-python@v5
5656
with:
5757
python-version: 3.9
5858

@@ -78,10 +78,10 @@ jobs:
7878
timeout-minutes: 10
7979

8080
steps:
81-
- uses: actions/checkout@v3
81+
- uses: actions/checkout@v4
8282

8383
- name: Set up Python 3.9 For Nox
84-
uses: actions/setup-python@v4
84+
uses: actions/setup-python@v5
8585
with:
8686
python-version: 3.9
8787

@@ -120,10 +120,10 @@ jobs:
120120
- "8.0.0"
121121

122122
steps:
123-
- uses: actions/checkout@v3
123+
- uses: actions/checkout@v4
124124

125125
- name: Set up Python ${{ matrix.python-version }}
126-
uses: actions/setup-python@v4
126+
uses: actions/setup-python@v5
127127
with:
128128
python-version: ${{ matrix.python-version }}
129129

@@ -168,7 +168,7 @@ jobs:
168168

169169
- name: Upload Logs
170170
if: always()
171-
uses: actions/upload-artifact@v3
171+
uses: actions/upload-artifact@v4
172172
with:
173173
name: runtests-${{ runner.os }}-Py${{ matrix.python-version}}-PyTest${{ matrix.pytest-version }}.log
174174
path: artifacts/runtests-*.log
@@ -193,10 +193,10 @@ jobs:
193193
- "8.0.0"
194194

195195
steps:
196-
- uses: actions/checkout@v3
196+
- uses: actions/checkout@v4
197197

198198
- name: Set up Python ${{ matrix.python-version }}
199-
uses: actions/setup-python@v4
199+
uses: actions/setup-python@v5
200200
with:
201201
python-version: ${{ matrix.python-version }}
202202

@@ -245,7 +245,7 @@ jobs:
245245

246246
- name: Upload Logs
247247
if: always()
248-
uses: actions/upload-artifact@v3
248+
uses: actions/upload-artifact@v4
249249
with:
250250
name: runtests-${{ runner.os }}-Py${{ matrix.python-version}}-PyTest${{ matrix.pytest-version }}.log
251251
path: artifacts/runtests-*.log
@@ -270,10 +270,10 @@ jobs:
270270
- "8.0.0"
271271

272272
steps:
273-
- uses: actions/checkout@v3
273+
- uses: actions/checkout@v4
274274

275275
- name: Set up Python ${{ matrix.python-version }}
276-
uses: actions/setup-python@v4
276+
uses: actions/setup-python@v5
277277
with:
278278
python-version: ${{ matrix.python-version }}
279279

@@ -318,7 +318,7 @@ jobs:
318318

319319
- name: Upload Logs
320320
if: always()
321-
uses: actions/upload-artifact@v3
321+
uses: actions/upload-artifact@v4
322322
with:
323323
name: runtests-${{ runner.os }}-Py${{ matrix.python-version}}-PyTest${{ matrix.pytest-version }}.log
324324
path: artifacts/runtests-*.log
@@ -334,11 +334,11 @@ jobs:
334334
- Windows
335335
- macOS
336336
steps:
337-
- uses: actions/checkout@v3
337+
- uses: actions/checkout@v4
338338
with:
339339
fetch-depth: 0
340340
- name: Set up Python
341-
uses: actions/setup-python@v4
341+
uses: actions/setup-python@v5
342342
with:
343343
python-version: 3.9
344344
- name: Install Nox
@@ -355,4 +355,4 @@ jobs:
355355
user: __token__
356356
password: ${{ secrets.TEST_PYPI_TOKEN }}
357357
repository_url: https://test.pypi.org/legacy/
358-
print_hash: true
358+
print-hash: true

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
minimum_pre_commit_version: 2.9.2
2+
minimum_pre_commit_version: 3.6.0
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.5.0
5+
rev: v4.6.0
66
hooks:
77
- id: check-merge-conflict # Check for files that contain merge conflict strings.
88
- id: trailing-whitespace
@@ -55,7 +55,7 @@ repos:
5555
exclude: ^src/pytestshellutils/(__init__|version)\.py$
5656

5757
- repo: https://github.com/asottile/reorder_python_imports
58-
rev: v3.12.0
58+
rev: v3.13.0
5959
hooks:
6060
- id: reorder-python-imports
6161
args:
@@ -79,7 +79,7 @@ repos:
7979
additional_dependencies: [black==24.2.0]
8080

8181
- repo: https://github.com/pre-commit/mirrors-mypy
82-
rev: v1.8.0
82+
rev: v1.11.1
8383
hooks:
8484
- id: mypy
8585
alias: mypy-tools
@@ -93,7 +93,7 @@ repos:
9393
- types-requests
9494

9595
- repo: https://github.com/s0undt3ch/python-tools-scripts
96-
rev: "0.20.0"
96+
rev: "0.20.5"
9797
hooks:
9898
- id: tools
9999
alias: actionlint
@@ -130,7 +130,7 @@ repos:
130130

131131
# ----- Code Analysis --------------------------------------------------------------------------------------------->
132132
- repo: https://github.com/pycqa/flake8
133-
rev: '7.0.0'
133+
rev: '7.1.1'
134134
hooks:
135135
- id: flake8
136136
exclude: ^(src/pytestshellutils/version\.py|\.pre-commit-hooks/.*\.py)$
@@ -142,7 +142,7 @@ repos:
142142
- flake8-typing-imports
143143

144144
- repo: https://github.com/pre-commit/mirrors-mypy
145-
rev: v1.8.0
145+
rev: v1.11.1
146146
hooks:
147147
- id: mypy
148148
files: ^((src|tests)/.*\.py)$

.readthedocs.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ version: 2
77

88
# Set the version of Python and other tools you might need
99
build:
10-
os: ubuntu-20.04
10+
os: ubuntu-22.04
1111
tools:
12-
python: "3.9"
12+
python: "3.10"
1313
# You can also specify other tool versions:
14-
# nodejs: "16"
15-
# rust: "1.55"
16-
# golang: "1.17"
14+
# nodejs: "20"
15+
# rust: "1.70"
16+
# golang: "1.20"
1717

1818
# Build documentation in the docs/ directory with Sphinx
1919
sphinx:
2020
configuration: docs/conf.py
2121

2222
# If using Sphinx, optionally build your docs in additional formats such as PDF
23-
formats:
24-
- pdf
23+
## formats:
24+
## - pdf
2525

2626
# Optionally declare the Python requirements required to build your docs
2727
python:

changelog/47.improvement.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added support for psutil 6.0.0, connections becomes net_connections

requirements/docs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
-r base.txt
22
-r tests.txt
33
-r changelog.txt
4+
towncrier <= 23.11.0
45
furo
56
sphinx
67
sphinx-copybutton

src/pytestshellutils/shell.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,9 +1278,9 @@ def _terminate_processes_matching_listen_ports(self) -> None:
12781278
# If any processes were not terminated and are listening on the ports
12791279
# we have set on listen_ports, terminate those processes.
12801280
found_processes = []
1281-
for process in psutil.process_iter(["connections"]):
1281+
for process in psutil.process_iter(["net_connections"]):
12821282
try:
1283-
for connection in process.connections():
1283+
for connection in process.net_connections():
12841284
if connection.status != psutil.CONN_LISTEN:
12851285
# We only care about listening services
12861286
continue
@@ -1289,7 +1289,7 @@ def _terminate_processes_matching_listen_ports(self) -> None:
12891289
# We already found one connection, no need to check the others
12901290
break
12911291
except psutil.AccessDenied: # pragma: no cover
1292-
# We've been denied access to this process connections. Carry on.
1292+
# We've been denied access to this process net_connections. Carry on.
12931293
continue
12941294
except psutil.ZombieProcess:
12951295
continue

0 commit comments

Comments
 (0)