Skip to content

Commit

Permalink
Merge branch '2.5.0' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoomakethu committed Feb 3, 2021
2 parents d4f5f9e + ffdc15c commit 7e8e7cf
Show file tree
Hide file tree
Showing 57 changed files with 1,452 additions and 248 deletions.
3 changes: 2 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
omit =
pymodbus/repl/*
pymodbus/internal/*
pymodbus/server/asyncio.py
pymodbus/server/asyncio.py
pymodbus/server/reactive/*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ test/__pycache__/
/doc/_build/
.pytest_cache/
**/.pymodhis
/build/
/dist/
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ before_install:

install:
# - scripts/travis.sh pip install pip-accel
- if [ $TRAVIS_OS_NAME = osx ]; then scripts/travis.sh pip install -U "\"setuptools<45"\"; else pip install -U setuptools --upgrade ; fi
- if [ $TRAVIS_OS_NAME = osx ]; then scripts/travis.sh pip install -U pip "\"setuptools<45"\"; else pip install -U pip setuptools --upgrade ; fi
- scripts/travis.sh pip install coveralls
- scripts/travis.sh pip install --requirement=requirements-checks.txt
- scripts/travis.sh pip install --requirement=requirements-tests.txt
- scripts/travis.sh LC_ALL=C pip install .
- scripts/travis.sh LC_ALL=C pip install --upgrade .
# - scripts/travis.sh pip freeze --all
script:
# - scripts/travis.sh make check
- scripts/travis.sh make test
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
version 2.5.0rc3
----------------------------------------------------------
* Minor fix in documentations
* Travis fix for Mac OSX
* Disable unnecessary deprecation warning while using async clients.
* Use Github actions for builds in favor of travis.


version 2.5.0rc2
----------------------------------------------------------
* Documentation updates
* Disable `strict` mode by default.
* Fix `ReportSlaveIdRequest` request
* Sparse datablock initialization updates.

version 2.5.0rc1
----------------------------------------------------------
* Support REPL for modbus server (only python3 and asyncio)
* Fix REPL client for write requests
* Fix examples
* Asyncio server
* Asynchronous server (with custom datablock)
* Fix version info for servers
* Fix and enhancements to Tornado clients (seril and tcp)
* Fix and enhancements to Asyncio client and server
* Update Install instructions
* Synchronous client retry on empty and error enhancments
* Add new modbus state `RETRYING`
* Support runtime response manipulations for Servers
* Bug fixes with logging module in servers
* Asyncio modbus serial server support

Version 2.4.0
----------------------------------------------------------
Expand Down
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,20 @@ check: install
test: install
@pip install --upgrade --quiet --requirement=requirements-tests.txt
ifeq ($(PYVER),3.6)
$(info Running tests on $(PYVER))
@pip install --upgrade pip --quiet
@pytest --cov=pymodbus/ --cov-report term-missing test/test_server_asyncio.py test
@coverage report --fail-under=85 -i
else ifeq ($(PYVER),2.7)
$(info Running tests on $(PYVER))
@pip install pip==20.3.4 --quiet
@pytest --cov-config=.coveragerc --cov=pymodbus/ --cov-report term-missing --ignore test/test_server_asyncio.py --ignore test/test_client_async_asyncio.py test
@coverage report --fail-under=90 -i
else
@pytest --cov=pymodbus/ --cov-report term-missing
@coverage report --fail-under=90 -i
$(info Running tests on $(PYVER))
@pip install --upgrade pip --quiet
@pytest --cov=pymodbus/ --cov-report term-missing test
@coverage report --fail-under=85 -i
endif

tox: install
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PyModbus - A Python Modbus Stack
.. image:: https://badges.gitter.im/Join%20Chat.svg
:target: https://gitter.im/pymodbus_dev/Lobby
.. image:: https://readthedocs.org/projects/pymodbus/badge/?version=latest
:target: http://pymodbus.readthedocs.io/en/async/?badge=latest
:target: http://pymodbus.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: http://pepy.tech/badge/pymodbus
:target: http://pepy.tech/project/pymodbus
Expand Down
6 changes: 3 additions & 3 deletions doc/INSTALL
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Requirements
-------------

* Python 2.3 or later.
* Python Twisted
* Python 2.7 or later.
* Python Twisted, Tornado or asyncio (For async client and server)
* Pyserial

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

python setup.py test
nosetests
pytest


Building Documentation
Expand Down
2 changes: 1 addition & 1 deletion doc/source/library/REPL.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ result.raw Return raw result dict.
```

Every command has auto suggetion on the arguments supported , supply arg and value are to be supplied in `arg=val` format.
Every command has auto suggestion on the arguments supported, arg and value are to be supplied in `arg=val` format.
```
> client.read_holding_registers count=4 address=9 unit=1
Expand Down
4 changes: 3 additions & 1 deletion examples/common/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ the tools/nullmodem/linux directory::

sudo ./run

The third method is Generic Unix method below.

------------------------------------------------------------
Windows
------------------------------------------------------------

For Windows, simply use the com2com application that is in
For Windows, simply use the com0com application that is in
the directory tools/nullmodem/windows. Instructions are
included in the Readme.txt.

Expand Down
7 changes: 4 additions & 3 deletions examples/common/asynchronous_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"""
# --------------------------------------------------------------------------- #
# import the various server implementations
# --------------------------------------------------------------------------- #
# --------------------------------------------------------------------------- #
from pymodbus.version import version
from pymodbus.server.asynchronous import StartTcpServer
from pymodbus.server.asynchronous import StartUdpServer
from pymodbus.server.asynchronous import StartSerialServer
Expand Down Expand Up @@ -105,10 +106,10 @@ def run_async_server():
identity = ModbusDeviceIdentification()
identity.VendorName = 'Pymodbus'
identity.ProductCode = 'PM'
identity.VendorUrl = 'http://github.com/bashwork/pymodbus/'
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
identity.ProductName = 'Pymodbus Server'
identity.ModelName = 'Pymodbus Server'
identity.MajorMinorRevision = '2.3.0'
identity.MajorMinorRevision = version.short()

# ----------------------------------------------------------------------- #
# run the server you want
Expand Down
17 changes: 9 additions & 8 deletions examples/common/asyncio_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# import the various server implementations
# --------------------------------------------------------------------------- #
import asyncio
from pymodbus.version import version
from pymodbus.server.async_io import StartTcpServer
from pymodbus.server.async_io import StartTlsServer
from pymodbus.server.async_io import StartUdpServer
Expand Down Expand Up @@ -107,22 +108,22 @@ async def run_server():
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
identity.ProductName = 'Pymodbus Server'
identity.ModelName = 'Pymodbus Server'
identity.MajorMinorRevision = '2.3.0'
identity.MajorMinorRevision = version.short()

# ----------------------------------------------------------------------- #
# run the server you want
# ----------------------------------------------------------------------- #
# Tcp:
# immediately start serving:
await StartTcpServer(context, identity=identity, address=("0.0.0.0", 5020), allow_reuse_address=True,
defer_start=False)
# await StartTcpServer(context, identity=identity, address=("0.0.0.0", 5020), allow_reuse_address=True,
# defer_start=False)

# deferred start:
# server = await StartTcpServer(context, identity=identity, address=("0.0.0.0", 5020),
# allow_reuse_address=True, defer_start=True)
#
# asyncio.get_event_loop().call_later(20, lambda : server.serve_forever)
# await server.serve_forever()
server = await StartTcpServer(context, identity=identity, address=("0.0.0.0", 5020),
allow_reuse_address=True, defer_start=True)

asyncio.get_event_loop().call_later(20, lambda: server.serve_forever)
await server.serve_forever()

# TCP with different framer
# StartTcpServer(context, identity=identity,
Expand Down
5 changes: 3 additions & 2 deletions examples/common/callback_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# --------------------------------------------------------------------------- #
# import the modbus libraries we need
# --------------------------------------------------------------------------- #
from pymodbus.version import version
from pymodbus.server.asynchronous import StartTcpServer
from pymodbus.device import ModbusDeviceIdentification
from pymodbus.datastore import ModbusSparseDataBlock
Expand Down Expand Up @@ -129,10 +130,10 @@ def run_callback_server():
identity = ModbusDeviceIdentification()
identity.VendorName = 'pymodbus'
identity.ProductCode = 'PM'
identity.VendorUrl = 'http://github.com/bashwork/pymodbus/'
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
identity.ProductName = 'pymodbus Server'
identity.ModelName = 'pymodbus Server'
identity.MajorMinorRevision = '2.3.0'
identity.MajorMinorRevision = version.short()

# ----------------------------------------------------------------------- #
# run the server you want
Expand Down
5 changes: 3 additions & 2 deletions examples/common/custom_datablock.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# import the modbus libraries we need
# --------------------------------------------------------------------------- #
from __future__ import print_function
from pymodbus.version import version
from pymodbus.server.asynchronous import StartTcpServer
from pymodbus.device import ModbusDeviceIdentification
from pymodbus.datastore import ModbusSparseDataBlock
Expand Down Expand Up @@ -65,10 +66,10 @@ def run_custom_db_server():
identity = ModbusDeviceIdentification()
identity.VendorName = 'pymodbus'
identity.ProductCode = 'PM'
identity.VendorUrl = 'http://github.com/bashwork/pymodbus/'
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
identity.ProductName = 'pymodbus Server'
identity.ModelName = 'pymodbus Server'
identity.MajorMinorRevision = '2.3.0'
identity.MajorMinorRevision = version.short()

# ----------------------------------------------------------------------- #
# run the server you want
Expand Down
4 changes: 2 additions & 2 deletions examples/common/custom_synchronous_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def decode(self, data):
# --------------------------------------------------------------------------- #
# import the various server implementations
# --------------------------------------------------------------------------- #
from pymodbus.version import version
from pymodbus.server.sync import StartTcpServer

from pymodbus.device import ModbusDeviceIdentification
from pymodbus.datastore import ModbusSequentialDataBlock
from pymodbus.datastore import ModbusSlaveContext, ModbusServerContext
Expand Down Expand Up @@ -101,7 +101,7 @@ def run_server():
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
identity.ProductName = 'Pymodbus Server'
identity.ModelName = 'Pymodbus Server'
identity.MajorMinorRevision = '2.3.0'
identity.MajorMinorRevision = version.short()

# ----------------------------------------------------------------------- #
# run the server you want
Expand Down
5 changes: 3 additions & 2 deletions examples/common/dbstore_update_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# --------------------------------------------------------------------------- #
# import the modbus libraries we need
# --------------------------------------------------------------------------- #
from pymodbus.version import version
from pymodbus.server.asynchronous import StartTcpServer
from pymodbus.device import ModbusDeviceIdentification
from pymodbus.datastore import ModbusSequentialDataBlock
Expand Down Expand Up @@ -83,10 +84,10 @@ def run_dbstore_update_server():
identity = ModbusDeviceIdentification()
identity.VendorName = 'pymodbus'
identity.ProductCode = 'PM'
identity.VendorUrl = 'http://github.com/bashwork/pymodbus/'
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
identity.ProductName = 'pymodbus Server'
identity.ModelName = 'pymodbus Server'
identity.MajorMinorRevision = '2.3.0'
identity.MajorMinorRevision = version.short()

# ----------------------------------------------------------------------- #
# run the server you want
Expand Down
2 changes: 1 addition & 1 deletion examples/common/modbus_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Pymodbus Payload Building/Decoding Example
--------------------------------------------------------------------------
# Run modbus-payload-server.py or synchronous-server.py to check the behavior
# Run modbus_payload_server.py or synchronous_server.py to check the behavior
"""
from pymodbus.constants import Endian
from pymodbus.payload import BinaryPayloadDecoder
Expand Down
6 changes: 3 additions & 3 deletions examples/common/modbus_payload_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# --------------------------------------------------------------------------- #
# import the various server implementations
# --------------------------------------------------------------------------- #
from pymodbus.version import version
from pymodbus.server.sync import StartTcpServer

from pymodbus.device import ModbusDeviceIdentification
from pymodbus.datastore import ModbusSequentialDataBlock
from pymodbus.datastore import ModbusSlaveContext, ModbusServerContext
Expand Down Expand Up @@ -77,10 +77,10 @@ def run_payload_server():
identity = ModbusDeviceIdentification()
identity.VendorName = 'Pymodbus'
identity.ProductCode = 'PM'
identity.VendorUrl = 'http://github.com/bashwork/pymodbus/'
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
identity.ProductName = 'Pymodbus Server'
identity.ModelName = 'Pymodbus Server'
identity.MajorMinorRevision = '2.3.0'
identity.MajorMinorRevision = version.short()
# ----------------------------------------------------------------------- #
# run the server you want
# ----------------------------------------------------------------------- #
Expand Down
3 changes: 2 additions & 1 deletion examples/common/synchronous_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# --------------------------------------------------------------------------- #
# import the various server implementations
# --------------------------------------------------------------------------- #
from pymodbus.version import version
from pymodbus.server.sync import StartTcpServer
from pymodbus.server.sync import StartTlsServer
from pymodbus.server.sync import StartUdpServer
Expand Down Expand Up @@ -106,7 +107,7 @@ def run_server():
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
identity.ProductName = 'Pymodbus Server'
identity.ModelName = 'Pymodbus Server'
identity.MajorMinorRevision = '2.3.0'
identity.MajorMinorRevision = version.short()

# ----------------------------------------------------------------------- #
# run the server you want
Expand Down
5 changes: 3 additions & 2 deletions examples/common/updating_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# --------------------------------------------------------------------------- #
# import the modbus libraries we need
# --------------------------------------------------------------------------- #
from pymodbus.version import version
from pymodbus.server.asynchronous import StartTcpServer
from pymodbus.device import ModbusDeviceIdentification
from pymodbus.datastore import ModbusSequentialDataBlock
Expand Down Expand Up @@ -75,10 +76,10 @@ def run_updating_server():
identity = ModbusDeviceIdentification()
identity.VendorName = 'pymodbus'
identity.ProductCode = 'PM'
identity.VendorUrl = 'http://github.com/bashwork/pymodbus/'
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
identity.ProductName = 'pymodbus Server'
identity.ModelName = 'pymodbus Server'
identity.MajorMinorRevision = '2.3.0'
identity.MajorMinorRevision = version.short()

# ----------------------------------------------------------------------- #
# run the server you want
Expand Down
5 changes: 3 additions & 2 deletions examples/contrib/deviceinfo_showcase_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"""
# --------------------------------------------------------------------------- #
# import the various server implementations
# --------------------------------------------------------------------------- #
# --------------------------------------------------------------------------- #
from pymodbus.version import version
from pymodbus.server.sync import StartTcpServer
from pymodbus.server.sync import StartUdpServer
from pymodbus.server.sync import StartSerialServer
Expand Down Expand Up @@ -55,7 +56,7 @@ def run_server():
identity.VendorUrl = 'http://github.com/riptideio/pymodbus/'
identity.ProductName = 'Pymodbus Server'
identity.ModelName = 'Pymodbus Server'
identity.MajorMinorRevision = '2.3.0'
identity.MajorMinorRevision = version.short()

# ----------------------------------------------------------------------- #
# Add an example which is long enough to force the ReadDeviceInformation
Expand Down
Loading

0 comments on commit 7e8e7cf

Please sign in to comment.