about summary refs log tree commit diff
path: root/pkgs/development/python-modules/django/4.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/django/4.nix')
-rw-r--r--pkgs/development/python-modules/django/4.nix169
1 files changed, 80 insertions, 89 deletions
diff --git a/pkgs/development/python-modules/django/4.nix b/pkgs/development/python-modules/django/4.nix
index bc1fcbdfe9c8d..11a2c7821c63f 100644
--- a/pkgs/development/python-modules/django/4.nix
+++ b/pkgs/development/python-modules/django/4.nix
@@ -1,98 +1,93 @@
-{ lib
-, stdenv
-, buildPythonPackage
-, fetchPypi
-, fetchpatch2
-, pythonAtLeast
-, pythonOlder
-, substituteAll
-
-# build
-, setuptools
-
-# patched in
-, geos
-, gdal
-, withGdal ? false
-
-# propagates
-, asgiref
-, sqlparse
-
-# extras
-, argon2-cffi
-, bcrypt
-
-# tests
-, aiosmtpd
-, docutils
-, geoip2
-, jinja2
-, numpy
-, pillow
-, pylibmc
-, pymemcache
-, python
-, pywatchman
-, pyyaml
-, pytz
-, redis
-, selenium
-, tblib
-, tzdata
+{
+  lib,
+  stdenv,
+  buildPythonPackage,
+  fetchFromGitHub,
+  pythonAtLeast,
+  pythonOlder,
+  substituteAll,
+
+  # build
+  setuptools,
+
+  # patched in
+  geos,
+  gdal,
+  withGdal ? false,
+
+  # propagates
+  asgiref,
+  sqlparse,
+
+  # extras
+  argon2-cffi,
+  bcrypt,
+
+  # tests
+  aiosmtpd,
+  docutils,
+  geoip2,
+  jinja2,
+  numpy,
+  pillow,
+  pylibmc,
+  pymemcache,
+  python,
+  pywatchman,
+  pyyaml,
+  pytz,
+  redis,
+  selenium,
+  tblib,
+  tzdata,
 }:
 
 buildPythonPackage rec {
   pname = "django";
-  version = "4.2.11";
+  version = "4.2.12";
   format = "pyproject";
 
   disabled = pythonOlder "3.8";
 
-  src = fetchPypi {
-    pname = "Django";
-    inherit version;
-    hash = "sha256-bm/z2y2N0MmGtO7IVUyOT5GbXB/2KltDkMF6/y7W5cQ=";
+  src = fetchFromGitHub {
+    owner = "django";
+    repo = "django";
+    rev = "refs/tags/${version}";
+    hash = "sha256-n6esWUpZpCP4J4bNckNKJ9E61qFjTPS7XF+WgxNS2JE=";
   };
 
-  patches = [
-    (substituteAll {
-      src = ./django_4_set_zoneinfo_dir.patch;
-      zoneinfo = tzdata + "/share/zoneinfo";
-    })
-    # make sure the tests don't remove packages from our pythonpath
-    # and disable failing tests
-    ./django_4_tests.patch
-
-    (fetchpatch2 {
-      # https://github.com/django/django/pull/17979
-      name = "django-mime-utf8-surrogates.patch";
-      url = "https://github.com/django/django/commit/0d3ddcaf2c74638a32781f361d467af572ced95f.patch";
-      hash = "sha256-AoIFvehBsXIrzIlCsqOZ++RqtDFl/H+zXqA25OMQr7g=";
-    })
-
-  ] ++ lib.optionals withGdal [
-    (substituteAll {
-      src = ./django_4_set_geos_gdal_lib.patch;
-      geos = geos;
-      gdal = gdal;
-      extension = stdenv.hostPlatform.extensions.sharedLibrary;
-    })
-  ];
+  patches =
+    [
+      (substituteAll {
+        src = ./django_4_set_zoneinfo_dir.patch;
+        zoneinfo = tzdata + "/share/zoneinfo";
+      })
+      # make sure the tests don't remove packages from our pythonpath
+      # and disable failing tests
+      ./django_4_tests.patch
+    ]
+    ++ lib.optionals withGdal [
+      (substituteAll {
+        src = ./django_4_set_geos_gdal_lib.patch;
+        geos = geos;
+        gdal = gdal;
+        extension = stdenv.hostPlatform.extensions.sharedLibrary;
+      })
+    ];
 
-  postPatch = ''
-    substituteInPlace tests/utils_tests/test_autoreload.py \
-      --replace "/usr/bin/python" "${python.interpreter}"
-  '' + lib.optionalString (pythonAtLeast "3.12" && stdenv.hostPlatform.system == "aarch64-linux") ''
-    # Test regression after xz was reverted from 5.6.0 to 5.4.6
-    # https://hydra.nixos.org/build/254630990
-    substituteInPlace tests/view_tests/tests/test_debug.py \
-      --replace-fail "test_files" "dont_test_files"
-  '';
+  postPatch =
+    ''
+      substituteInPlace tests/utils_tests/test_autoreload.py \
+        --replace "/usr/bin/python" "${python.interpreter}"
+    ''
+    + lib.optionalString (pythonAtLeast "3.12" && stdenv.hostPlatform.system == "aarch64-linux") ''
+      # Test regression after xz was reverted from 5.6.0 to 5.4.6
+      # https://hydra.nixos.org/build/254630990
+      substituteInPlace tests/view_tests/tests/test_debug.py \
+        --replace-fail "test_files" "dont_test_files"
+    '';
 
-  nativeBuildInputs = [
-    setuptools
-  ];
+  nativeBuildInputs = [ setuptools ];
 
   propagatedBuildInputs = [
     asgiref
@@ -100,12 +95,8 @@ buildPythonPackage rec {
   ];
 
   passthru.optional-dependencies = {
-    argon2 = [
-      argon2-cffi
-    ];
-    bcrypt = [
-      bcrypt
-    ];
+    argon2 = [ argon2-cffi ];
+    bcrypt = [ bcrypt ];
   };
 
   nativeCheckInputs = [