From 44dd19be4b1528c8513289defdef92b7c0146b51 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 26 May 2022 03:42:07 +0000 Subject: [PATCH 1/2] python310Packages.python-snap7: 1.1 -> 1.2 --- pkgs/development/python-modules/python-snap7/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/python-snap7/default.nix b/pkgs/development/python-modules/python-snap7/default.nix index 0d34262ea3bb..f3d4a09ff76f 100644 --- a/pkgs/development/python-modules/python-snap7/default.nix +++ b/pkgs/development/python-modules/python-snap7/default.nix @@ -2,13 +2,13 @@ buildPythonPackage rec { pname = "python-snap7"; - version = "1.1"; + version = "1.2"; src = fetchFromGitHub { owner = "gijzelaerr"; repo = "python-snap7"; - rev = version; - sha256 = "18z13wb2q5q3msp9w3wddg1byp7picczw4ng8w1ccj4npidxsqv8"; + rev = "refs/tags/${version}"; + sha256 = "sha256-xkkJE3wTqS6spwEmQ+HBY1Szao1VFoqmQ041vnAYuqQ="; }; propagatedBuildInputs = [ setuptools six ]; From 0bf74b17041e419bd027ee6d2d0b6e82b1f37166 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 26 May 2022 08:12:37 +0200 Subject: [PATCH 2/2] python310Packages.python-snap7: disable on older Python releases --- .../python-modules/python-snap7/default.nix | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/python-snap7/default.nix b/pkgs/development/python-modules/python-snap7/default.nix index f3d4a09ff76f..8322d1c4d379 100644 --- a/pkgs/development/python-modules/python-snap7/default.nix +++ b/pkgs/development/python-modules/python-snap7/default.nix @@ -1,17 +1,28 @@ -{ lib, buildPythonPackage, snap7, fetchFromGitHub, six, setuptools }: +{ lib +, buildPythonPackage +, snap7 +, fetchFromGitHub +, setuptools +, pythonOlder +}: buildPythonPackage rec { pname = "python-snap7"; version = "1.2"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; src = fetchFromGitHub { owner = "gijzelaerr"; repo = "python-snap7"; rev = "refs/tags/${version}"; - sha256 = "sha256-xkkJE3wTqS6spwEmQ+HBY1Szao1VFoqmQ041vnAYuqQ="; + hash = "sha256-xkkJE3wTqS6spwEmQ+HBY1Szao1VFoqmQ041vnAYuqQ="; }; - propagatedBuildInputs = [ setuptools six ]; + propagatedBuildInputs = [ + setuptools + ]; prePatch = '' substituteInPlace snap7/common.py \ @@ -19,7 +30,6 @@ buildPythonPackage rec { ''; # Tests require root privileges to open privilaged ports - # We cannot run them doCheck = false; pythonImportsCheck = [ @@ -28,7 +38,7 @@ buildPythonPackage rec { ]; meta = with lib; { - description = "Python wrapper for the snap7 PLC communication library "; + description = "Python wrapper for the snap7 PLC communication library"; homepage = "https://github.com/gijzelaerr/python-snap7"; license = licenses.mit; maintainers = with maintainers; [ freezeboy ];