about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/spake2/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/spake2/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/spake2/default.nix38
1 files changed, 31 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/spake2/default.nix b/nixpkgs/pkgs/development/python-modules/spake2/default.nix
index 87d05612e712..2ccd62fcdf15 100644
--- a/nixpkgs/pkgs/development/python-modules/spake2/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/spake2/default.nix
@@ -1,26 +1,50 @@
-{ lib, buildPythonPackage, fetchPypi, hkdf, pytest }:
+{ lib
+, buildPythonPackage
+, fetchPypi
+, fetchpatch2
+, setuptools
+, hkdf
+, pytestCheckHook
+}:
 
 buildPythonPackage rec {
   pname = "spake2";
   version = "0.8";
-  format = "setuptools";
+  pyproject = true;
 
   src = fetchPypi {
     inherit pname version;
     sha256 = "c17a614b29ee4126206e22181f70a406c618d3c6c62ca6d6779bce95e9c926f4";
   };
 
-  nativeCheckInputs = [ pytest ];
+  patches = [
+    # https://github.com/warner/python-spake2/pull/16
+    (fetchpatch2 {
+      name = "python312-compat.patch";
+      url = "https://github.com/warner/python-spake2/commit/1b04d33106b105207c97c64b2589c45790720b0b.patch";
+      hash = "sha256-OoBz0lN17VyVGg6UfT+Zj9M1faFTNpPIhxrwCgUwMc8=";
+    })
+  ];
 
-  propagatedBuildInputs = [ hkdf ];
+  nativeBuildInputs = [
+    setuptools
+  ];
 
-  checkPhase = ''
-    py.test $out
-  '';
+  propagatedBuildInputs = [
+    hkdf
+  ];
+
+  pythonImportsCheck = [ "spake2" ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ];
 
   meta = with lib; {
+    changelog = "https://github.com/warner/python-spake2/blob/v${version}/NEWS";
     description = "SPAKE2 password-authenticated key exchange library";
     homepage = "https://github.com/warner/python-spake2";
     license = licenses.mit;
+    maintainers = with maintainers; [ dotlambda ];
   };
 }