Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pymodbus-dev/pymodbus
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.5.0
Choose a base ref
...
head repository: pymodbus-dev/pymodbus
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 433 changed files with 27,553 additions and 34,688 deletions.
2 changes: 0 additions & 2 deletions .coveragerc

This file was deleted.

7 changes: 7 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye"
"postCreateCommand": "pip3 install -e ."
}
30 changes: 17 additions & 13 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
<!--
Please use the Pymodbus gitter channel at https://gitter.im/pymodbus_dev/Lobby or Stack Overflow(tag [pymodbus](https://stackoverflow.com/questions/tagged/pymodbus) for
support questions.
Before opening a new issue, make sure you do the following:
* check that your issue isn't already filed: https://github.com/riptideio/pymodbus/issues
* prepare a short, runnable example that reproduce the issue with the latest development version of Pymodbus
- Check that your issue isn't already filed: https://github.com/pymodbus-dev/pymodbus/issues
- Check the discussions forum https://github.com/pymodbus-dev/pymodbus/discussions
- Prepare a short, runnable example that reproduce the issue with the latest development version of Pymodbus
-->

### Versions

* Python:
* OS:
* Pymodbus:
* Modbus Hardware (if used):
- Python:
- OS:
- Pymodbus:
- Modbus Hardware (if used):

### Pymodbus Specific
* Server: tcp/rtu/ascii - sync/async
* Client: tcp/rtu/ascii - sync/async

- Server: tcp/rtu/ascii - sync/async
- Client: tcp/rtu/ascii - sync/async

### Description

What were you trying, what has happened, what went wrong, and what did you expect?
<!-- What were you trying, what has happened, what went wrong, and what did you expect? -->

### Code and Logs

```python
# code and logs here.
# code and logs here.

# please use the following to format logs when posting them here
import pymodbus

pymodbus.pymodbus_apply_logging_config("DEBUG")
```
151 changes: 151 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
name: CI
on:
push:
branches:
- dev
- master
- wait_next_API
tags:
- v*
pull_request:
branches:
- dev
- wait_next_api
types: [opened, synchronize, reopened, ready_for_review]
schedule:
# Sunday at 02:10 UTC.
- cron: '10 2 * * 0'
workflow_dispatch:

jobs:
faildraft:
name: fail draft
if: github.event.pull_request.draft == true
runs-on: ubuntu-latest
steps:
- name: fail draft
run: |
exit 1
testing:
name: ${{ matrix.os }} - ${{ matrix.python }}
if: github.event.pull_request.draft == false
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.10', '3.11', '3.12', "3.13.0"]
include:
- python: '3.10'
run_lint: true
- python: '3.13.0'
run_doc: true
run_lint: true
- os: macos-latest
run_doc: false
run_lint: false
- os: windows-latest
run_doc: false
run_lint: false

steps:
- name: Checkout repo from github
uses: actions/checkout@v4.2.2

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5.4.0
with:
python-version: ${{ matrix.python }}

- name: Set venv path (NON Windows)
if: matrix.os != 'windows-latest'
run: |
echo "VIRTUAL_ENV=${{ github.workspace }}/venv" >> $GITHUB_ENV
echo ${{ github.workspace }}/venv/bin >> $GITHUB_PATH
- name: Set venv path (Windows)
if: matrix.os == 'windows-latest'
run: |
echo "VIRTUAL_ENV=${{ github.workspace }}\\venv" >> $Env:GITHUB_ENV
echo "${{ github.workspace }}\\venv\\Scripts" >> $Env:GITHUB_PATH
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache@v4.2.0
with:
path: ${{ env.VIRTUAL_ENV }}
key: >-
${{ runner.os }}-${{ matrix.python }}-venv-${{
hashFiles('pyproject.toml') }}
- name: Create venv (NEW CACHE)
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
python -m venv ${{ env.VIRTUAL_ENV }}
python -m pip install --upgrade pip
pip install -e ".[all]"
- name: codespell
if: matrix.run_doc == true
run: |
codespell
- name: dcoumentation
if: matrix.run_doc == true
run: |
cd doc; ./build_html
- name: pylint
if: matrix.run_lint == true
run: |
pylint --recursive=y examples pymodbus test
- name: mypy
if: matrix.run_lint == true
run: |
mypy pymodbus examples
- name: ruff
if: matrix.run_lint == true
run: |
ruff check .
- name: pytest
if: ${{ (matrix.os != 'ubuntu-latest') || (matrix.python != '3.13') }}
run: |
env
pytest
- name: pytest coverage
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python == '3.13') }}
run: |
env
pytest --cov
analyze:
name: Analyze Python
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4.2.2

- uses: github/codeql-action/init@v3
with:
languages: python

- uses: github/codeql-action/autobuild@v3

- uses: github/codeql-action/analyze@v3

ci_complete:
name: ci_complete
runs-on: ubuntu-latest
needs:
- analyze
- testing
timeout-minutes: 1
steps:
- run: echo 'finish job'
41 changes: 41 additions & 0 deletions .github/workflows/clean_workflow_runs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Clean workflow runs
on:
workflow_dispatch:

permissions:
actions: write

jobs:
del_runs:
runs-on: ubuntu-latest
steps:
- name: Delete old workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 3
keep_minimum_runs: 0


clear-cache:
runs-on: ubuntu-latest
steps:
- name: Clear cache
uses: actions/github-script@v7
with:
script: |
console.log("About to clear")
const caches = await github.rest.actions.getActionsCacheList({
owner: context.repo.owner,
repo: context.repo.repo,
})
for (const cache of caches.data.actions_caches) {
console.log(cache)
github.rest.actions.deleteActionsCacheById({
owner: context.repo.owner,
repo: context.repo.repo,
cache_id: cache.id,
})
}
console.log("Clear completed")
39 changes: 39 additions & 0 deletions .github/workflows/stale_lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "30 1 * * *"
workflow_dispatch:

permissions:
issues: write
pull-requests: write
discussions: write

concurrency:
group: lock

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
days-before-issue-stale: 30
days-before-pr-stale: 45
days-before-issue-close: 5
days-before-pr-close: 10
stale-issue-label: 'no-issue-activity'
exempt-issue-labels: 'Bug,Enhancements,Investigating'
stale-pr-label: 'no-pr-activity'
remove-stale-when-updated: true
- uses: dessant/lock-threads@v5
with:
github-token: ${{ github.token }}
discussion-inactive-days: '10'
process-only: 'discussions'
42 changes: 16 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
*.pyc
*.swp
build/
dist/
pymodbus.egg-info/
__pycache__/
.*cache/
.coverage
.vscode
.DS_Store
.eggs/
.idea
.noseids
*.db
.idea/
.tox/
doc/api/epydoc/html/
.vscode/
.noseids
.pymodhis
.pypirc
.venv
__pycache__/
pymodbus/__pycache__/
pymodbus/client/__pycache__/
pymodbus/datastore/__pycache__/
pymodbus/internal/__pycache__/
pymodbus/server/__pycache__/
test/__pycache__/
**/pymodbus.db
/.eggs/
/.cache/
/doc/sphinx/doctrees/
/doc_new/
/doc/quality/
/doc/pymodbus.pdf
/doc/sphinx/
/doc/html/
/doc/_build/
.vscode
.vscode/
prof/
dist/pymodbus*
build/html
/pymodbus.egg-info/
venv
downloaded_files/
pymodbus.log
17 changes: 0 additions & 17 deletions .project

This file was deleted.

8 changes: 0 additions & 8 deletions .pydevproject

This file was deleted.

23 changes: 17 additions & 6 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
# Build PDF & ePub
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
configuration: doc/conf.py

python:
install:
- method: pip
path: .
extra_requirements:
- documentation

formats:
- epub
- pdf
requirements_file: requirements-docs.txt
python:
extra_requirements:
- twisted
- documents
Loading