about summary refs log tree commit diff
path: root/pkgs/development/python-modules/django/5.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/django/5.nix')
-rw-r--r--pkgs/development/python-modules/django/5.nix173
1 files changed, 82 insertions, 91 deletions
diff --git a/pkgs/development/python-modules/django/5.nix b/pkgs/development/python-modules/django/5.nix
index fc4ba20245fce..6bb8432f149d6 100644
--- a/pkgs/development/python-modules/django/5.nix
+++ b/pkgs/development/python-modules/django/5.nix
@@ -1,99 +1,94 @@
-{ lib
-, stdenv
-, buildPythonPackage
-, fetchPypi
-, fetchpatch2
-, pythonAtLeast
-, pythonOlder
-, substituteAll
-
-# build-system
-, setuptools
-
-# patched in
-, geos
-, gdal
-, withGdal ? false
-
-# dependencies
-, asgiref
-, sqlparse
-
-# optional-dependencies
-, 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-system
+  setuptools,
+
+  # patched in
+  geos,
+  gdal,
+  withGdal ? false,
+
+  # dependencies
+  asgiref,
+  sqlparse,
+
+  # optional-dependencies
+  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 = "5.0.4";
+  version = "5.0.5";
   pyproject = true;
 
   disabled = pythonOlder "3.10";
 
-  src = fetchPypi {
-    pname = "Django";
-    inherit version;
-    hash = "sha256-S9AajIMLt3qKOw59iyW4h+U2rReoG6Lc5UdhNcczEr0=";
+  src = fetchFromGitHub {
+    owner = "django";
+    repo = "django";
+    rev = "refs/tags/${version}";
+    hash = "sha256-0/AbPmTl38E9BpHVKs0r79fISjEa1d4XO/se1pA7zxg=";
   };
 
-  patches = [
-    (substituteAll {
-      src = ./django_5_set_zoneinfo_dir.patch;
-      zoneinfo = tzdata + "/share/zoneinfo";
-    })
-    # prevent tests from messing with our pythonpath
-    ./django_5_tests_pythonpath.patch
-    # disable test that excpects timezone issues
-    ./django_5_disable_failing_tests.patch
-
-    (fetchpatch2 {
-      # https://github.com/django/django/pull/17979
-      name = "django-mime-utf8-surrogates.patch";
-      url = "https://github.com/django/django/commit/b231bcd19e57267ce1fc21d42d46f0b65fdcfcf8.patch";
-      hash = "sha256-HhmRwi24VkoPoh+NygAThCoMywoMwrLijU4ZsDfVU34=";
-    })
-
-  ] ++ lib.optionals withGdal [
-    (substituteAll {
-      src = ./django_5_set_geos_gdal_lib.patch;
-      geos = geos;
-      gdal = gdal;
-      extension = stdenv.hostPlatform.extensions.sharedLibrary;
-    })
-  ];
+  patches =
+    [
+      (substituteAll {
+        src = ./django_5_set_zoneinfo_dir.patch;
+        zoneinfo = tzdata + "/share/zoneinfo";
+      })
+      # prevent tests from messing with our pythonpath
+      ./django_5_tests_pythonpath.patch
+      # disable test that excpects timezone issues
+      ./django_5_disable_failing_tests.patch
+    ]
+    ++ lib.optionals withGdal [
+      (substituteAll {
+        src = ./django_5_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/254532197
-    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/254532197
+      substituteInPlace tests/view_tests/tests/test_debug.py \
+        --replace-fail "test_files" "dont_test_files"
+    '';
 
-  build-system = [
-    setuptools
-  ];
+  build-system = [ setuptools ];
 
   dependencies = [
     asgiref
@@ -101,12 +96,8 @@ buildPythonPackage rec {
   ];
 
   optional-dependencies = {
-    argon2 = [
-      argon2-cffi
-    ];
-    bcrypt = [
-      bcrypt
-    ];
+    argon2 = [ argon2-cffi ];
+    bcrypt = [ bcrypt ];
   };
 
   nativeCheckInputs = [
@@ -152,7 +143,7 @@ buildPythonPackage rec {
 
   meta = with lib; {
     changelog = "https://docs.djangoproject.com/en/${lib.versions.majorMinor version}/releases/${version}/";
-    description = "A high-level Python Web framework that encourages rapid development and clean, pragmatic design.";
+    description = "High-level Python Web framework that encourages rapid development and clean, pragmatic design";
     homepage = "https://www.djangoproject.com";
     license = licenses.bsd3;
     maintainers = with maintainers; [ hexa ];