Skip to content
Snippets Groups Projects
Commit 629f1aca authored by Benjamin Koch's avatar Benjamin Koch
Browse files

add modbus-tk and newer version of pymodbus to our Nix shell

parent fc56556e
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
qrcodegen = python-final.callPackage nix/qrcodegen.nix { }; qrcodegen = python-final.callPackage nix/qrcodegen.nix { };
svgutils = python-final.callPackage nix/svgutils.nix { }; svgutils = python-final.callPackage nix/svgutils.nix { };
pcbnewTransition = python-final.callPackage nix/pcbnewTransition.nix { }; pcbnewTransition = python-final.callPackage nix/pcbnewTransition.nix { };
modbus-tk = python-final.callPackage nix/modbus-tk.nix { };
pymodbus3 = python-final.callPackage nix/pymodbus3.nix { };
}) })
]; ];
other.python3Packages = self.packages.${system}.python3.pkgs; other.python3Packages = self.packages.${system}.python3.pkgs;
...@@ -153,6 +156,7 @@ ...@@ -153,6 +156,7 @@
devShells.rust = with self.packages.${system}; pkgs.mkShell { devShells.rust = with self.packages.${system}; pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
rustup udev.dev pkg-config openssl.dev picotool rustup udev.dev pkg-config openssl.dev picotool
(self.packages.${system}.python3.withPackages (p: with p; [ pymodbus3 pyserial modbus-tk ]))
]; ];
}; };
} }
......
{ lib
, buildPythonPackage
, fetchFromGitHub
, pyserial
}:
buildPythonPackage rec {
pname = "modbus-tk";
version = "git";
src = fetchFromGitHub {
owner = "ljean";
repo = pname;
rev = "f32bb42cda8be3122fefad59a35b5c5fe6bcf567";
hash = "sha256-wKFRi6xcStuQURJ3Lo48P0lFDfg33Zt3NLJzqvu138U=";
};
# Twisted asynchronous version is not supported due to a missing dependency
propagatedBuildInputs = [
pyserial
];
pythonImportsCheck = [ "modbus_tk" ];
}
\ No newline at end of file
# based on https://github.com/NixOS/nixpkgs/blob/c8a17ce7abc03c50cd072e9e6c9b389c5f61836b/pkgs/development/python-modules/pymodbus/default.nix
{ lib
, aiohttp
, asynctest
, buildPythonPackage
, click
, fetchFromGitHub
, mock
, prompt-toolkit
, pygments
, pyserial
, pyserial-asyncio
, pytestCheckHook
, redis
, sqlalchemy
, tornado
, twisted
, pytest-asyncio
, pytest-xdist
}:
buildPythonPackage rec {
pname = "pymodbus";
version = "3.2.2";
src = fetchFromGitHub {
owner = "pymodbus-dev";
repo = pname;
rev = "v${version}";
hash = "sha256-Hw7oGYzjcHBTBjE9vf+3D8DzXdqVuHbJmIMH0W3mwE4=";
};
# Twisted asynchronous version is not supported due to a missing dependency
propagatedBuildInputs = [
aiohttp
click
prompt-toolkit
pygments
pyserial
pyserial-asyncio
tornado
];
checkInputs = [
asynctest
mock
pytestCheckHook
redis
sqlalchemy
twisted
pytest-asyncio
pytest-xdist
];
pythonImportsCheck = [ "pymodbus" ];
# many tests fail because self.loop is None in TestAsyncioServer
#FIXME We should figure this out but that's not a priority here because we don't use async, yet.
doCheck = false;
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.
'';
homepage = "https://github.com/riptideio/pymodbus";
license = with licenses; [ bsd3 ];
maintainers = with maintainers; [ fab ];
};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment