about summary refs log tree commit diff
path: root/pkgs/development/python-modules/django-timezone-field/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/django-timezone-field/default.nix')
-rw-r--r--pkgs/development/python-modules/django-timezone-field/default.nix45
1 files changed, 21 insertions, 24 deletions
diff --git a/pkgs/development/python-modules/django-timezone-field/default.nix b/pkgs/development/python-modules/django-timezone-field/default.nix
index c111c4aff6d4a..978ae2e8e39e4 100644
--- a/pkgs/development/python-modules/django-timezone-field/default.nix
+++ b/pkgs/development/python-modules/django-timezone-field/default.nix
@@ -6,50 +6,47 @@
   poetry-core,
   django,
   djangorestframework,
-  pytz,
-  pytest,
+  pytestCheckHook,
+  pytest-django,
   pytest-lazy-fixture,
-  python,
+  pytz,
 }:
 
 buildPythonPackage rec {
   pname = "django-timezone-field";
-  version = "5.1";
-  disabled = pythonOlder "3.5";
-  format = "pyproject";
+  version = "7.0";
+  pyproject = true;
+
+  disabled = pythonOlder "3.8";
 
   src = fetchFromGitHub {
     owner = "mfogel";
     repo = pname;
     rev = version;
-    hash = "sha256-FAYO8OEE/h4rsbC4Oc57ylWV7TqQ6DOd6/2M+mb/AsM=";
+    hash = "sha256-q06TuYkBA4z6tJdT3an6Z8o1i/o85XbYa1JYZBHC8lI=";
   };
 
-  nativeBuildInputs = [ poetry-core ];
-
-  propagatedBuildInputs = [
-    django
-    djangorestframework
-    pytz
-  ];
+  build-system = [ poetry-core ];
 
-  pythonImportsCheck = [ "timezone_field" ];
+  dependencies = [ django ];
 
-  # Uses pytest.lazy_fixture directly which is broken in pytest-lazy-fixture
-  # https://github.com/TvoroG/pytest-lazy-fixture/issues/22
-  doCheck = false;
+  pythonImportsCheck = [
+    # Requested setting USE_DEPRECATED_PYTZ, but settings are not configured.
+    #"timezone_field"
+  ];
 
-  DJANGO_SETTINGS_MODULE = "tests.settings";
+  preCheck = ''
+    export DJANGO_SETTINGS_MODULE=tests.settings
+  '';
 
   nativeCheckInputs = [
-    pytest
+    djangorestframework
+    pytestCheckHook
+    pytest-django
     pytest-lazy-fixture
+    pytz
   ];
 
-  checkPhase = ''
-    ${python.interpreter} -m django test
-  '';
-
   meta = with lib; {
     description = "Django app providing database, form and serializer fields for pytz timezone objects";
     homepage = "https://github.com/mfogel/django-timezone-field";