Files
nixpkgs/pkgs/development/python-modules/python-snap7/default.nix
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

47 lines
950 B
Nix

{
lib,
buildPythonPackage,
snap7,
fetchFromGitHub,
setuptools,
pythonOlder,
}:
buildPythonPackage rec {
pname = "python-snap7";
version = "2.0.2";
pyproject = true;
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "gijzelaerr";
repo = "python-snap7";
tag = version;
hash = "sha256-mcdzgR0z2P5inK9Q+ZQhP5H8vZSaPbRCSEnt+wzG+ro=";
};
prePatch = ''
substituteInPlace snap7/common.py \
--replace "lib_location = None" "lib_location = '${snap7}/lib/libsnap7.so'"
'';
build-system = [ setuptools ];
# Tests require root privileges to open privileged ports
doCheck = false;
pythonImportsCheck = [
"snap7"
"snap7.util"
];
meta = {
description = "Python wrapper for the snap7 PLC communication library";
mainProgram = "snap7-server";
homepage = "https://github.com/gijzelaerr/python-snap7";
license = lib.licenses.mit;
maintainers = [ ];
};
}