Skip to content

Commit 1b12541

Browse files
committed
Merge branch 'dev'
2 parents 844913d + 684083f commit 1b12541

File tree

185 files changed

+5479
-11006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+5479
-11006
lines changed

.github/workflows/ci.yml

+60-52
Original file line numberDiff line numberDiff line change
@@ -17,74 +17,72 @@ on:
1717

1818

1919
jobs:
20+
linters:
21+
name: Linters
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 10
24+
strategy:
25+
fail-fast: false
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v3
29+
30+
- name: Set up python
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: 3.8
34+
35+
- name: venv restore
36+
id: cache-venv
37+
uses: syphar/restore-virtualenv@v1
38+
with:
39+
requirement_files: requirements.txt
40+
41+
- name: venv create
42+
if: steps.cache-venv.outputs.cache-hit != 'true'
43+
run: pip install -e . -r requirements.txt
44+
45+
- name: codespell
46+
run: codespell
47+
48+
- name: pylint
49+
run: pylint --recursive=y examples pymodbus test
50+
51+
- name: precommit (black, bandit, and ruff)
52+
run: pre-commit run --all-files
53+
54+
- name: docs
55+
run: make -C doc/ html
56+
57+
- name: mypy
58+
run: mypy pymodbus
59+
60+
2061
integreation_test:
21-
name: ${{ matrix.task.name }} - ${{ matrix.os.on }} - ${{ matrix.python.version }}
62+
name: pytest - ${{ matrix.os.on }} - ${{ matrix.python.version }}
2263
runs-on: ${{ matrix.os.on }}
64+
needs: linters
2365
timeout-minutes: 10
2466
strategy:
2567
fail-fast: false
2668
matrix:
27-
task:
28-
- name: pylint
29-
cmd: pylint --recursive=y examples pymodbus test
30-
type: lint
31-
- name: codespell
32-
cmd: codespell
33-
type: lint
34-
- name: bandit
35-
cmd: bandit -r -c bandit.yaml .
36-
type: lint
37-
- name: flake8
38-
cmd: flake8
39-
type: lint
40-
- name: precommit (isort and black)
41-
cmd: pre-commit run --all-files
42-
type: lint
43-
- name: docs
44-
cmd: make -C doc/ html
45-
type: lint
46-
- name: mypy
47-
cmd: mypy pymodbus
48-
type: lint
49-
- name: pytest
50-
cmd: pytest --cov=pymodbus --cov=test --cov-report=term-missing --cov-report=xml -v --full-trace --timeout=20
51-
type: test
5269
os:
53-
- name: Linux
54-
on: ubuntu-latest
55-
lint: 'yes'
56-
- name: Macos
57-
on: macos-latest
58-
lint: 'no'
59-
- name: Windows
60-
on: windows-latest
61-
lint: 'no'
70+
- on: ubuntu-latest
71+
- on: macos-latest
72+
- on: windows-latest
6273
python:
6374
- version: '3.8'
64-
lint: 'yes'
6575
- version: '3.9'
66-
lint: 'no'
6776
- version: '3.10'
68-
lint: 'no'
6977
- version: '3.11'
70-
lint: 'no'
7178
- version: pypy-3.8
72-
lint: 'no'
7379
exclude:
74-
- task:
75-
type: lint
76-
os:
77-
lint: 'no'
78-
- task:
79-
type: lint
80-
python:
81-
lint: 'no'
8280
- os:
83-
name: Macos
81+
on: macos-latest
8482
python:
8583
version: pypy-3.8
8684
- os:
87-
name: Windows
85+
on: windows-latest
8886
python:
8987
version: pypy-3.8
9088
steps:
@@ -106,5 +104,15 @@ jobs:
106104
if: steps.cache-venv.outputs.cache-hit != 'true'
107105
run: pip install -e . -r requirements.txt
108106

109-
- name: test/lint
110-
run: ${{ matrix.task.cmd }}
107+
- name: pytest
108+
run: pytest --cov=pymodbus --cov=test --cov-report=term-missing --cov-report=xml -v --full-trace --timeout=20
109+
110+
ci_complete:
111+
name: ci_complete
112+
runs-on: ubuntu-latest
113+
needs:
114+
- integreation_test
115+
timeout-minutes: 1
116+
steps:
117+
- name: Dummy
118+
run: ls

.github/workflows/clean_cache.yml

-33
This file was deleted.
+34-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
name: Clean workflow runs
22
on:
3+
# schedule:
4+
# # Monthly day 1 at 0:35 UTC.
5+
# - cron: '35 0 1 1-12 *'
36
workflow_dispatch:
47
inputs:
5-
days:
8+
retain_days:
69
description: 'retain days (default 14)'
7-
required: false
10+
required: true
811
default: 14
9-
keeps:
12+
keep_minimum_runs:
1013
description: 'keep minimum runs (default 6)'
11-
required: false
14+
required: true
1215
default: 6
13-
schedule:
14-
# Sunday at 02:35 UTC.
15-
- cron: '35 2 * * 0'
16+
17+
permissions:
18+
actions: write
1619

1720
jobs:
1821
del_runs:
@@ -23,5 +26,27 @@ jobs:
2326
with:
2427
token: ${{ github.token }}
2528
repository: ${{ github.repository }}
26-
retain_days: ${{ github.events.inputs.days }}
27-
keep_minimum_runs: ${{ github.events.inputs.keeps }}
29+
retain_days: ${{ github.events.inputs.retain_days }}
30+
keep_minimum_runs: ${{ github.events.inputs.keep_minimum_runs }}
31+
32+
clear-cache:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Clear cache
36+
uses: actions/github-script@v6
37+
with:
38+
script: |
39+
console.log("About to clear")
40+
const caches = await github.rest.actions.getActionsCacheList({
41+
owner: context.repo.owner,
42+
repo: context.repo.repo,
43+
})
44+
for (const cache of caches.data.actions_caches) {
45+
console.log(cache)
46+
github.rest.actions.deleteActionsCacheById({
47+
owner: context.repo.owner,
48+
repo: context.repo.repo,
49+
cache_id: cache.id,
50+
})
51+
}
52+
console.log("Clear completed")

.github/workflows/lock.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: 'Lock Threads'
2+
3+
on:
4+
schedule:
5+
# Every night at 02:20 UTC.
6+
- cron: '20 2 * * *'
7+
workflow_dispatch:
8+
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
13+
concurrency:
14+
group: lock
15+
16+
jobs:
17+
action:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: dessant/lock-threads@v4
21+
with:
22+
github-token: ${{ github.token }}
23+
issue-inactive-days: '10'
24+
pr-inactive-days: '10'

.github/workflows/publish1.yml.NO_RUN

-27
This file was deleted.

.github/workflows/publish2.yml.NO_RUN

-27
This file was deleted.

.github/workflows/stale.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ name: Mark stale issues and pull requests
33
on:
44
schedule:
55
- cron: "30 1 * * *"
6+
workflow_dispatch:
67

78
jobs:
89
stale:
9-
1010
runs-on: ubuntu-latest
11-
1211
steps:
1312
- uses: actions/stale@v3
1413
with:
@@ -22,9 +21,6 @@ jobs:
2221
days-before-issue-close: 5
2322
days-before-pr-close: 10
2423
stale-issue-label: 'no-issue-activity'
25-
exempt-issue-labels: 'Bug,Enhancements,Investigating,in progress,Documentation Update Required,3.x'
24+
exempt-issue-labels: 'Bug,Enhancements,Investigating'
2625
stale-pr-label: 'no-pr-activity'
27-
exempt-pr-labels: 'IN REVIEW,Reviewing,Draft,in progress,3.x,2.5.0'
2826
remove-stale-when-updated: true
29-
# only-labels: "More Information Required, Not an Issue, question, Won't Do"
30-

.pre-commit-config.yaml

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
# See https://pre-commit.com for more information
2-
# See https://pre-commit.com/hooks.html for more hooks
1+
---
2+
default_language_version:
3+
python: python
4+
35
repos:
46
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v3.2.0
7+
rev: v4.4.0
68
hooks:
79
- id: trailing-whitespace
8-
# - id: end-of-file-fixer
10+
- id: end-of-file-fixer
911
- id: check-yaml
1012
- id: check-added-large-files
11-
- repo: https://github.com/pycqa/isort
12-
rev: 5.12.0
13+
# run ruff with --fix before black
14+
- repo: https://github.com/charliermarsh/ruff-pre-commit
15+
rev: 'v0.0.263'
1316
hooks:
14-
- id: isort
15-
exclude: ^(doc/_build|venv|.venv|.git|pymodbus/client/serial_asyncio)
17+
- id: ruff
18+
args: [--fix, --exit-non-zero-on-fix]
1619
- repo: https://github.com/psf/black
17-
rev: 22.12.0
20+
rev: 23.3.0
1821
hooks:
1922
- id: black
20-
args: [--safe,--quiet]
23+
args: [--safe, --quiet]
2124
files: (examples|pymodbus|test)/

.pydevproject

-8
This file was deleted.

0 commit comments

Comments
 (0)