Skip to content

Commit 7e8e7cf

Browse files
committed
Merge branch '2.5.0' into dev
2 parents d4f5f9e + ffdc15c commit 7e8e7cf

Some content is hidden

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

57 files changed

+1452
-248
lines changed

.coveragerc

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
omit =
33
pymodbus/repl/*
44
pymodbus/internal/*
5-
pymodbus/server/asyncio.py
5+
pymodbus/server/asyncio.py
6+
pymodbus/server/reactive/*

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ test/__pycache__/
3737
/doc/_build/
3838
.pytest_cache/
3939
**/.pymodhis
40+
/build/
41+
/dist/

.travis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ before_install:
2020

2121
install:
2222
# - scripts/travis.sh pip install pip-accel
23-
- if [ $TRAVIS_OS_NAME = osx ]; then scripts/travis.sh pip install -U "\"setuptools<45"\"; else pip install -U setuptools --upgrade ; fi
23+
- if [ $TRAVIS_OS_NAME = osx ]; then scripts/travis.sh pip install -U pip "\"setuptools<45"\"; else pip install -U pip setuptools --upgrade ; fi
2424
- scripts/travis.sh pip install coveralls
2525
- scripts/travis.sh pip install --requirement=requirements-checks.txt
2626
- scripts/travis.sh pip install --requirement=requirements-tests.txt
27-
- scripts/travis.sh LC_ALL=C pip install .
27+
- scripts/travis.sh LC_ALL=C pip install --upgrade .
28+
# - scripts/travis.sh pip freeze --all
2829
script:
2930
# - scripts/travis.sh make check
3031
- scripts/travis.sh make test

CHANGELOG.rst

+31
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
version 2.5.0rc3
2+
----------------------------------------------------------
3+
* Minor fix in documentations
4+
* Travis fix for Mac OSX
5+
* Disable unnecessary deprecation warning while using async clients.
6+
* Use Github actions for builds in favor of travis.
7+
8+
9+
version 2.5.0rc2
10+
----------------------------------------------------------
11+
* Documentation updates
12+
* Disable `strict` mode by default.
13+
* Fix `ReportSlaveIdRequest` request
14+
* Sparse datablock initialization updates.
15+
16+
version 2.5.0rc1
17+
----------------------------------------------------------
18+
* Support REPL for modbus server (only python3 and asyncio)
19+
* Fix REPL client for write requests
20+
* Fix examples
21+
* Asyncio server
22+
* Asynchronous server (with custom datablock)
23+
* Fix version info for servers
24+
* Fix and enhancements to Tornado clients (seril and tcp)
25+
* Fix and enhancements to Asyncio client and server
26+
* Update Install instructions
27+
* Synchronous client retry on empty and error enhancments
28+
* Add new modbus state `RETRYING`
29+
* Support runtime response manipulations for Servers
30+
* Bug fixes with logging module in servers
31+
* Asyncio modbus serial server support
132

233
Version 2.4.0
334
----------------------------------------------------------

Makefile

+11-2
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,20 @@ check: install
4242
test: install
4343
@pip install --upgrade --quiet --requirement=requirements-tests.txt
4444
ifeq ($(PYVER),3.6)
45+
$(info Running tests on $(PYVER))
46+
@pip install --upgrade pip --quiet
4547
@pytest --cov=pymodbus/ --cov-report term-missing test/test_server_asyncio.py test
48+
@coverage report --fail-under=85 -i
49+
else ifeq ($(PYVER),2.7)
50+
$(info Running tests on $(PYVER))
51+
@pip install pip==20.3.4 --quiet
52+
@pytest --cov-config=.coveragerc --cov=pymodbus/ --cov-report term-missing --ignore test/test_server_asyncio.py --ignore test/test_client_async_asyncio.py test
4653
@coverage report --fail-under=90 -i
4754
else
48-
@pytest --cov=pymodbus/ --cov-report term-missing
49-
@coverage report --fail-under=90 -i
55+
$(info Running tests on $(PYVER))
56+
@pip install --upgrade pip --quiet
57+
@pytest --cov=pymodbus/ --cov-report term-missing test
58+
@coverage report --fail-under=85 -i
5059
endif
5160

5261
tox: install

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PyModbus - A Python Modbus Stack
77
.. image:: https://badges.gitter.im/Join%20Chat.svg
88
:target: https://gitter.im/pymodbus_dev/Lobby
99
.. image:: https://readthedocs.org/projects/pymodbus/badge/?version=latest
10-
:target: http://pymodbus.readthedocs.io/en/async/?badge=latest
10+
:target: http://pymodbus.readthedocs.io/en/latest/?badge=latest
1111
:alt: Documentation Status
1212
.. image:: http://pepy.tech/badge/pymodbus
1313
:target: http://pepy.tech/project/pymodbus

doc/INSTALL

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Requirements
22
-------------
33

4-
* Python 2.3 or later.
5-
* Python Twisted
4+
* Python 2.7 or later.
5+
* Python Twisted, Tornado or asyncio (For async client and server)
66
* Pyserial
77

88
On Windows pywin32 is recommended (this is built in to ActivePython,
@@ -35,7 +35,7 @@ much easier to run with the nose package. With that installed, you can
3535
use either of the following::
3636

3737
python setup.py test
38-
nosetests
38+
pytest
3939

4040

4141
Building Documentation

doc/source/library/REPL.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ result.raw Return raw result dict.
200200
201201
```
202202

203-
Every command has auto suggetion on the arguments supported , supply arg and value are to be supplied in `arg=val` format.
203+
Every command has auto suggestion on the arguments supported, arg and value are to be supplied in `arg=val` format.
204204
```
205205
206206
> client.read_holding_registers count=4 address=9 unit=1

examples/common/README.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,13 @@ the tools/nullmodem/linux directory::
9292

9393
sudo ./run
9494

95+
The third method is Generic Unix method below.
96+
9597
------------------------------------------------------------
9698
Windows
9799
------------------------------------------------------------
98100

99-
For Windows, simply use the com2com application that is in
101+
For Windows, simply use the com0com application that is in
100102
the directory tools/nullmodem/windows. Instructions are
101103
included in the Readme.txt.
102104

examples/common/asynchronous_server.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"""
1010
# --------------------------------------------------------------------------- #
1111
# import the various server implementations
12-
# --------------------------------------------------------------------------- #
12+
# --------------------------------------------------------------------------- #
13+
from pymodbus.version import version
1314
from pymodbus.server.asynchronous import StartTcpServer
1415
from pymodbus.server.asynchronous import StartUdpServer
1516
from pymodbus.server.asynchronous import StartSerialServer
@@ -105,10 +106,10 @@ def run_async_server():
105106
identity = ModbusDeviceIdentification()
106107
identity.VendorName = 'Pymodbus'
107108
identity.ProductCode = 'PM'
108-
identity.VendorUrl = 'http://github.com/bashwork/pymodbus/'
109+
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
109110
identity.ProductName = 'Pymodbus Server'
110111
identity.ModelName = 'Pymodbus Server'
111-
identity.MajorMinorRevision = '2.3.0'
112+
identity.MajorMinorRevision = version.short()
112113

113114
# ----------------------------------------------------------------------- #
114115
# run the server you want

examples/common/asyncio_server.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# import the various server implementations
1313
# --------------------------------------------------------------------------- #
1414
import asyncio
15+
from pymodbus.version import version
1516
from pymodbus.server.async_io import StartTcpServer
1617
from pymodbus.server.async_io import StartTlsServer
1718
from pymodbus.server.async_io import StartUdpServer
@@ -107,22 +108,22 @@ async def run_server():
107108
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
108109
identity.ProductName = 'Pymodbus Server'
109110
identity.ModelName = 'Pymodbus Server'
110-
identity.MajorMinorRevision = '2.3.0'
111+
identity.MajorMinorRevision = version.short()
111112

112113
# ----------------------------------------------------------------------- #
113114
# run the server you want
114115
# ----------------------------------------------------------------------- #
115116
# Tcp:
116117
# immediately start serving:
117-
await StartTcpServer(context, identity=identity, address=("0.0.0.0", 5020), allow_reuse_address=True,
118-
defer_start=False)
118+
# await StartTcpServer(context, identity=identity, address=("0.0.0.0", 5020), allow_reuse_address=True,
119+
# defer_start=False)
119120

120121
# deferred start:
121-
# server = await StartTcpServer(context, identity=identity, address=("0.0.0.0", 5020),
122-
# allow_reuse_address=True, defer_start=True)
123-
#
124-
# asyncio.get_event_loop().call_later(20, lambda : server.serve_forever)
125-
# await server.serve_forever()
122+
server = await StartTcpServer(context, identity=identity, address=("0.0.0.0", 5020),
123+
allow_reuse_address=True, defer_start=True)
124+
125+
asyncio.get_event_loop().call_later(20, lambda: server.serve_forever)
126+
await server.serve_forever()
126127

127128
# TCP with different framer
128129
# StartTcpServer(context, identity=identity,

examples/common/callback_server.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# --------------------------------------------------------------------------- #
1111
# import the modbus libraries we need
1212
# --------------------------------------------------------------------------- #
13+
from pymodbus.version import version
1314
from pymodbus.server.asynchronous import StartTcpServer
1415
from pymodbus.device import ModbusDeviceIdentification
1516
from pymodbus.datastore import ModbusSparseDataBlock
@@ -129,10 +130,10 @@ def run_callback_server():
129130
identity = ModbusDeviceIdentification()
130131
identity.VendorName = 'pymodbus'
131132
identity.ProductCode = 'PM'
132-
identity.VendorUrl = 'http://github.com/bashwork/pymodbus/'
133+
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
133134
identity.ProductName = 'pymodbus Server'
134135
identity.ModelName = 'pymodbus Server'
135-
identity.MajorMinorRevision = '2.3.0'
136+
identity.MajorMinorRevision = version.short()
136137

137138
# ----------------------------------------------------------------------- #
138139
# run the server you want

examples/common/custom_datablock.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# import the modbus libraries we need
1111
# --------------------------------------------------------------------------- #
1212
from __future__ import print_function
13+
from pymodbus.version import version
1314
from pymodbus.server.asynchronous import StartTcpServer
1415
from pymodbus.device import ModbusDeviceIdentification
1516
from pymodbus.datastore import ModbusSparseDataBlock
@@ -65,10 +66,10 @@ def run_custom_db_server():
6566
identity = ModbusDeviceIdentification()
6667
identity.VendorName = 'pymodbus'
6768
identity.ProductCode = 'PM'
68-
identity.VendorUrl = 'http://github.com/bashwork/pymodbus/'
69+
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
6970
identity.ProductName = 'pymodbus Server'
7071
identity.ModelName = 'pymodbus Server'
71-
identity.MajorMinorRevision = '2.3.0'
72+
identity.MajorMinorRevision = version.short()
7273

7374
# ----------------------------------------------------------------------- #
7475
# run the server you want

examples/common/custom_synchronous_server.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def decode(self, data):
6060
# --------------------------------------------------------------------------- #
6161
# import the various server implementations
6262
# --------------------------------------------------------------------------- #
63+
from pymodbus.version import version
6364
from pymodbus.server.sync import StartTcpServer
64-
6565
from pymodbus.device import ModbusDeviceIdentification
6666
from pymodbus.datastore import ModbusSequentialDataBlock
6767
from pymodbus.datastore import ModbusSlaveContext, ModbusServerContext
@@ -101,7 +101,7 @@ def run_server():
101101
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
102102
identity.ProductName = 'Pymodbus Server'
103103
identity.ModelName = 'Pymodbus Server'
104-
identity.MajorMinorRevision = '2.3.0'
104+
identity.MajorMinorRevision = version.short()
105105

106106
# ----------------------------------------------------------------------- #
107107
# run the server you want

examples/common/dbstore_update_server.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# --------------------------------------------------------------------------- #
1717
# import the modbus libraries we need
1818
# --------------------------------------------------------------------------- #
19+
from pymodbus.version import version
1920
from pymodbus.server.asynchronous import StartTcpServer
2021
from pymodbus.device import ModbusDeviceIdentification
2122
from pymodbus.datastore import ModbusSequentialDataBlock
@@ -83,10 +84,10 @@ def run_dbstore_update_server():
8384
identity = ModbusDeviceIdentification()
8485
identity.VendorName = 'pymodbus'
8586
identity.ProductCode = 'PM'
86-
identity.VendorUrl = 'http://github.com/bashwork/pymodbus/'
87+
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
8788
identity.ProductName = 'pymodbus Server'
8889
identity.ModelName = 'pymodbus Server'
89-
identity.MajorMinorRevision = '2.3.0'
90+
identity.MajorMinorRevision = version.short()
9091

9192
# ----------------------------------------------------------------------- #
9293
# run the server you want

examples/common/modbus_payload.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Pymodbus Payload Building/Decoding Example
44
--------------------------------------------------------------------------
55
6-
# Run modbus-payload-server.py or synchronous-server.py to check the behavior
6+
# Run modbus_payload_server.py or synchronous_server.py to check the behavior
77
"""
88
from pymodbus.constants import Endian
99
from pymodbus.payload import BinaryPayloadDecoder

examples/common/modbus_payload_server.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
# --------------------------------------------------------------------------- #
1010
# import the various server implementations
1111
# --------------------------------------------------------------------------- #
12+
from pymodbus.version import version
1213
from pymodbus.server.sync import StartTcpServer
13-
1414
from pymodbus.device import ModbusDeviceIdentification
1515
from pymodbus.datastore import ModbusSequentialDataBlock
1616
from pymodbus.datastore import ModbusSlaveContext, ModbusServerContext
@@ -77,10 +77,10 @@ def run_payload_server():
7777
identity = ModbusDeviceIdentification()
7878
identity.VendorName = 'Pymodbus'
7979
identity.ProductCode = 'PM'
80-
identity.VendorUrl = 'http://github.com/bashwork/pymodbus/'
80+
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
8181
identity.ProductName = 'Pymodbus Server'
8282
identity.ModelName = 'Pymodbus Server'
83-
identity.MajorMinorRevision = '2.3.0'
83+
identity.MajorMinorRevision = version.short()
8484
# ----------------------------------------------------------------------- #
8585
# run the server you want
8686
# ----------------------------------------------------------------------- #

examples/common/synchronous_server.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# --------------------------------------------------------------------------- #
1212
# import the various server implementations
1313
# --------------------------------------------------------------------------- #
14+
from pymodbus.version import version
1415
from pymodbus.server.sync import StartTcpServer
1516
from pymodbus.server.sync import StartTlsServer
1617
from pymodbus.server.sync import StartUdpServer
@@ -106,7 +107,7 @@ def run_server():
106107
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
107108
identity.ProductName = 'Pymodbus Server'
108109
identity.ModelName = 'Pymodbus Server'
109-
identity.MajorMinorRevision = '2.3.0'
110+
identity.MajorMinorRevision = version.short()
110111

111112
# ----------------------------------------------------------------------- #
112113
# run the server you want

examples/common/updating_server.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# --------------------------------------------------------------------------- #
1616
# import the modbus libraries we need
1717
# --------------------------------------------------------------------------- #
18+
from pymodbus.version import version
1819
from pymodbus.server.asynchronous import StartTcpServer
1920
from pymodbus.device import ModbusDeviceIdentification
2021
from pymodbus.datastore import ModbusSequentialDataBlock
@@ -75,10 +76,10 @@ def run_updating_server():
7576
identity = ModbusDeviceIdentification()
7677
identity.VendorName = 'pymodbus'
7778
identity.ProductCode = 'PM'
78-
identity.VendorUrl = 'http://github.com/bashwork/pymodbus/'
79+
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
7980
identity.ProductName = 'pymodbus Server'
8081
identity.ModelName = 'pymodbus Server'
81-
identity.MajorMinorRevision = '2.3.0'
82+
identity.MajorMinorRevision = version.short()
8283

8384
# ----------------------------------------------------------------------- #
8485
# run the server you want

examples/contrib/deviceinfo_showcase_server.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"""
1111
# --------------------------------------------------------------------------- #
1212
# import the various server implementations
13-
# --------------------------------------------------------------------------- #
13+
# --------------------------------------------------------------------------- #
14+
from pymodbus.version import version
1415
from pymodbus.server.sync import StartTcpServer
1516
from pymodbus.server.sync import StartUdpServer
1617
from pymodbus.server.sync import StartSerialServer
@@ -55,7 +56,7 @@ def run_server():
5556
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
5657
identity.ProductName = 'Pymodbus Server'
5758
identity.ModelName = 'Pymodbus Server'
58-
identity.MajorMinorRevision = '2.3.0'
59+
identity.MajorMinorRevision = version.short()
5960

6061
# ----------------------------------------------------------------------- #
6162
# Add an example which is long enough to force the ReadDeviceInformation

0 commit comments

Comments
 (0)