python3Packages.python-snap7: init 0.11

This commit is contained in:
freezeboy 2020-09-13 06:04:12 +02:00 committed by Jon
parent 1be6ac06ab
commit 7849d11478
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,37 @@
{ lib, buildPythonPackage, snap7, fetchFromGitHub, six, setuptools }:
buildPythonPackage rec {
pname = "python-snap7";
version = "0.11";
src = fetchFromGitHub {
owner = "gijzelaerr";
repo = "python-snap7";
rev = "899a94c6eeca76fb9b18afd5056e5003646d7f94";
sha256 = "169zd1nxq86nmi6132vxl1f6wxm9w3waihq2wn14kkmld1vkmvfd";
};
propagatedBuildInputs = [ setuptools six ];
prePatch = ''
substituteInPlace snap7/common.py \
--replace "lib_location = None" "lib_location = '${snap7}/lib/libsnap7.so'"
'';
# Tests require root privileges to open privilaged ports
# We cannot run them
doCheck = false;
pythonImportsCheck = [
"snap7"
"snap7.six"
"snap7.util"
];
meta = with lib; {
description = "Python wrapper for the snap7 PLC communication library ";
homepage = "https://github.com/gijzelaerr/python-snap7";
license = licenses.mit;
maintainers = with maintainers; [ freezeboy ];
};
}

View File

@ -5746,6 +5746,10 @@ in {
python-slugify = callPackage ../development/python-modules/python-slugify { };
python-snap7 = callPackage ../development/python-modules/python-snap7 {
inherit (pkgs) snap7;
};
python-snappy = callPackage ../development/python-modules/python-snappy { inherit (pkgs) snappy; };
python-socketio = callPackage ../development/python-modules/python-socketio { };