2021-01-09 10:05:03 +00:00
|
|
|
{ lib
|
2021-04-08 16:26:57 +00:00
|
|
|
, aiohttp
|
2021-01-09 10:05:03 +00:00
|
|
|
, buildPythonPackage
|
2021-04-08 16:26:57 +00:00
|
|
|
, click
|
2021-01-09 10:05:03 +00:00
|
|
|
, fetchFromGitHub
|
2021-08-05 21:33:18 +00:00
|
|
|
, prompt-toolkit
|
2021-04-08 16:26:57 +00:00
|
|
|
, pygments
|
2021-01-09 10:05:03 +00:00
|
|
|
, pyserial
|
2023-01-20 10:41:00 +00:00
|
|
|
, pytest-asyncio
|
2023-02-02 18:25:31 +00:00
|
|
|
, pytest-xdist
|
2021-01-09 10:05:03 +00:00
|
|
|
, pytestCheckHook
|
2023-10-19 13:55:26 +00:00
|
|
|
, pythonOlder
|
2021-01-09 10:05:03 +00:00
|
|
|
, redis
|
2023-10-19 13:55:26 +00:00
|
|
|
, setuptools
|
2021-01-09 10:05:03 +00:00
|
|
|
, sqlalchemy
|
|
|
|
, twisted
|
2023-10-09 19:29:22 +00:00
|
|
|
, typer
|
2021-01-09 10:05:03 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pymodbus";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "3.5.4";
|
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
2021-01-09 10:05:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-02-02 18:25:31 +00:00
|
|
|
owner = "pymodbus-dev";
|
2021-01-09 10:05:03 +00:00
|
|
|
repo = pname;
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-IgGDYNIRS39t8vHkJSGnDGCTKxpeIYZyedLzyS5pOI0=";
|
2021-01-09 10:05:03 +00:00
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
repl = [
|
|
|
|
aiohttp
|
|
|
|
typer
|
|
|
|
prompt-toolkit
|
|
|
|
pygments
|
|
|
|
click
|
|
|
|
] ++ typer.optional-dependencies.all;
|
|
|
|
serial = [
|
|
|
|
pyserial
|
|
|
|
];
|
|
|
|
};
|
2021-01-09 10:05:03 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-01-20 10:41:00 +00:00
|
|
|
pytest-asyncio
|
2023-02-02 18:25:31 +00:00
|
|
|
pytest-xdist
|
2021-01-09 10:05:03 +00:00
|
|
|
pytestCheckHook
|
|
|
|
redis
|
|
|
|
sqlalchemy
|
|
|
|
twisted
|
2023-10-09 19:29:22 +00:00
|
|
|
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
|
2021-01-09 10:05:03 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
preCheck = ''
|
|
|
|
pushd test
|
|
|
|
'';
|
|
|
|
|
|
|
|
postCheck = ''
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pymodbus"
|
2023-02-02 18:25:31 +00:00
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Tests often hang
|
|
|
|
"test_connected"
|
2024-01-02 11:29:13 +00:00
|
|
|
] ++ lib.optionals (lib.versionAtLeast aiohttp.version "3.9.0") [
|
|
|
|
"test_split_serial_packet"
|
|
|
|
"test_serial_poll"
|
|
|
|
"test_simulator"
|
2023-10-09 19:29:22 +00:00
|
|
|
];
|
2021-01-09 10:05:03 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python implementation of the Modbus protocol";
|
|
|
|
longDescription = ''
|
|
|
|
Pymodbus is a full Modbus protocol implementation using twisted,
|
|
|
|
torndo or asyncio for its asynchronous communications core. It can
|
|
|
|
also be used without any third party dependencies if a more
|
|
|
|
lightweight project is needed.
|
|
|
|
'';
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://github.com/pymodbus-dev/pymodbus";
|
|
|
|
changelog = "https://github.com/pymodbus-dev/pymodbus/releases/tag/v${version}";
|
2021-01-09 10:05:03 +00:00
|
|
|
license = with licenses; [ bsd3 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|