about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/django-otp/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/django-otp/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/django-otp/default.nix41
1 files changed, 29 insertions, 12 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/django-otp/default.nix b/nixpkgs/pkgs/development/python-modules/django-otp/default.nix
index 216b24e3c0c0..c1078160b6eb 100644
--- a/nixpkgs/pkgs/development/python-modules/django-otp/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/django-otp/default.nix
@@ -1,46 +1,63 @@
 { lib
 , buildPythonPackage
 , fetchFromGitHub
+, hatchling
 , django
 , freezegun
-, pythonOlder
 , qrcode
+, pytest
+, python
 }:
 
 buildPythonPackage rec {
   pname = "django-otp";
-  version = "1.1.3";
-  format = "setuptools";
-  disabled = pythonOlder "3";
+  version = "1.3.0post1";
+  pyproject = true;
 
   src = fetchFromGitHub {
     owner = "django-otp";
     repo = "django-otp";
     rev = "v${version}";
-    hash = "sha256-Ac9p7q9yaUr3WTTGxCY16Yo/Z8i1RtnD2g0Aj2pqSXY=";
+    hash = "sha256-Q8YTCYERyoAXenSiDabxuxaWiD6ZeJKKKgaR/Rg3y20=";
   };
 
-  postPatch = ''
-    patchShebangs manage.py
-  '';
+  build-system = [
+    hatchling
+  ];
 
-  propagatedBuildInputs = [
+  dependencies = [
     django
     qrcode
   ];
 
+  env.DJANGO_SETTINGS_MODUOLE = "test.test_project.settings";
+
   nativeCheckInputs = [
     freezegun
+    pytest
   ];
 
   checkPhase = ''
-    ./manage.py test django_otp
+    runHook preCheck
+
+    export PYTHONPATH=$PYTHONPATH:test
+    export DJANGO_SETTINGS_MODULE=test_project.settings
+    ${python.interpreter} -m django test django_otp
+
+    runHook postCheck
   '';
 
-  pythonImportsCheck = [ "django_otp" ];
+  pytestFlagsArray = [
+    "src/django_otp/test.py"
+  ];
+
+  pythonImportsCheck = [
+    "django_otp"
+  ];
 
   meta = with lib; {
-    homepage = "https://github.com/jazzband/django-model-utils";
+    homepage = "https://github.com/django-otp/django-otp";
+    changelog = "https://github.com/django-otp/django-otp/blob/${src.rev}/CHANGES.rst";
     description = "Pluggable framework for adding two-factor authentication to Django using one-time passwords";
     license = licenses.bsd2;
     maintainers = with maintainers; [ ];