about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pysnmpcrypto/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pysnmpcrypto/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/pysnmpcrypto/default.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pysnmpcrypto/default.nix b/nixpkgs/pkgs/development/python-modules/pysnmpcrypto/default.nix
new file mode 100644
index 000000000000..ffeb9dddfbd8
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pysnmpcrypto/default.nix
@@ -0,0 +1,57 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+
+# build-system
+, setuptools
+
+# dependencies
+, cryptography
+, pycryptodomex
+
+# tests
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "pysnmpcrypto";
+  version = "0.0.4";
+  pyproject = true;
+
+  src = fetchPypi {
+    inherit pname version;
+    hash = "sha256-tjX7Ox7GY3uaADP1BQYhThbrhFdLHSWrAnu95MqlUSk=";
+  };
+
+  postPatch = ''
+    # ValueError: invalid literal for int() with base 10: 'post0' in File "<string>", line 104, in <listcomp>
+    substituteInPlace setup.py --replace \
+      "observed_version = [int(x) for x in setuptools.__version__.split('.')]" \
+      "observed_version = [36, 2, 0]"
+  '';
+
+  nativeBuildInputs = [
+    setuptools
+  ];
+
+  propagatedBuildInputs = [
+    cryptography
+    pycryptodomex
+  ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "pysnmpcrypto"
+  ];
+
+  meta = with lib; {
+    description = "Strong crypto support for Python SNMP library";
+    homepage = "https://github.com/etingof/pysnmpcrypto";
+    changelog = "https://github.com/etingof/pysnmpcrypto/blob/${version}/CHANGES.txt";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ ];
+  };
+}