about summary refs log tree commit diff
path: root/pkgs/development/python-modules/phe/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/phe/default.nix')
-rw-r--r--pkgs/development/python-modules/phe/default.nix51
1 files changed, 34 insertions, 17 deletions
diff --git a/pkgs/development/python-modules/phe/default.nix b/pkgs/development/python-modules/phe/default.nix
index 0dc423883c4bd..0cf03e077cdc7 100644
--- a/pkgs/development/python-modules/phe/default.nix
+++ b/pkgs/development/python-modules/phe/default.nix
@@ -1,31 +1,48 @@
-{ lib, buildPythonPackage, fetchPypi, isPyPy, isPy3k, click, gmpy2, numpy } :
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+  isPyPy,
+  isPy3k,
+  setuptools,
+  click,
+  gmpy2,
+  pytestCheckHook,
+  numpy,
+}:
 
-let
+buildPythonPackage rec {
   pname = "phe";
-  version = "1.5.0";
-  format = "setuptools";
-in
+  version = "1.5.1";
+  pyproject = true;
 
-buildPythonPackage {
-  inherit pname version;
+  # https://github.com/data61/python-paillier/issues/51
+  disabled = isPyPy || !isPy3k;
 
-  # https://github.com/n1analytics/python-paillier/issues/51
-  disabled = isPyPy || ! isPy3k;
-
-  src = fetchPypi {
-    inherit pname version;
-    hash = "sha256-mS+3CR0kJ/DZczlG+PNQrN1NHQEgV/Kq02S6eflwM5w=";
+  src = fetchFromGitHub {
+    owner = "data61";
+    repo = "python-paillier";
+    rev = "refs/tags/${version}";
+    hash = "sha256-P//4ZL4+2zcB5sWvujs2N0CHFz+EBLERWrPGLLHj6CY=";
   };
 
-  buildInputs = [ click gmpy2 numpy ];
+  build-system = [ setuptools ];
+
+  dependencies = [
+    click
+    gmpy2 # optional, but major speed improvement
+  ];
 
-  # 29/233 tests fail
-  doCheck = false;
+  nativeCheckInputs = [
+    pytestCheckHook
+    numpy
+  ];
 
   meta = with lib; {
     description = "A library for Partially Homomorphic Encryption in Python";
     mainProgram = "pheutil";
-    homepage = "https://github.com/n1analytics/python-paillier";
+    homepage = "https://github.com/data61/python-paillier";
     license = licenses.gpl3;
+    maintainers = with maintainers; [ tomasajt ];
   };
 }