@@ -0,0 +1,59 @@
1+{ lib
2+, asynctest
3+, buildPythonPackage
4+, fetchFromGitHub
5+, mock
6+, pyserial
7+, pyserial-asyncio
8+, pytestCheckHook
9+, pythonOlder
10+, redis
11+, sqlalchemy
12+, tornado
13+, twisted
14+}:
15+
16+buildPythonPackage rec {
17+ pname = "pymodbus";
18+ version = "2.4.0";
19+
20+ src = fetchFromGitHub {
21+ owner = "riptideio";
22+ repo = pname;
23+ rev = "v${version}";
24+ sha256 = "0x0dv02shcc2yxxm9kvcbhip111sna74dvcfssxdzzy967vnq76v";
25+ };
26+
27+ # Twisted asynchronous version is not supported due to a missing dependency
28+ propagatedBuildInputs = [
29+ pyserial
30+ pyserial-asyncio
31+ tornado
32+ ];
33+
34+ checkInputs = [
35+ asynctest
36+ mock
37+ pyserial-asyncio
38+ pytestCheckHook
39+ redis
40+ sqlalchemy
41+ tornado
42+ twisted
43+ ];
44+
45+ pythonImportsCheck = [ "pymodbus" ];
46+
47+ meta = with lib; {
48+ description = "Python implementation of the Modbus protocol";
49+ longDescription = ''
50+ Pymodbus is a full Modbus protocol implementation using twisted,
51+ torndo or asyncio for its asynchronous communications core. It can
52+ also be used without any third party dependencies if a more
53+ lightweight project is needed.
54+ '';
55+ homepage = "https://github.com/riptideio/pymodbus";
56+ license = with licenses; [ bsd3 ];
57+ maintainers = with maintainers; [ fab ];
58+ };
59+}