python312Packages.jax: 0.4.38 -> 0.5.0 (#374810)
[NixPkgs.git] / pkgs / development / python-modules / django-polymorphic / default.nix
blob86bc344fd07000f78a868b14bf453c397d2f3070
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   fetchpatch,
6   python,
7   django,
8   dj-database-url,
9 }:
11 buildPythonPackage rec {
12   pname = "django-polymorphic";
13   version = "3.1";
14   format = "setuptools";
16   src = fetchFromGitHub {
17     owner = "django-polymorphic";
18     repo = "django-polymorphic";
19     rev = "v${version}";
20     hash = "sha256-JJY+FoMPSnWuSsNIas2JedGJpdm6RfPE3E1VIjGuXIc=";
21   };
23   patches = [
24     # Spelling of assertQuerySetEqual changed in Django >= 4.2
25     (fetchpatch {
26       url = "https://github.com/jazzband/django-polymorphic/commit/63d291f8771847e716a37652f239e3966a3360e1.patch";
27       hash = "sha256-rvvD9zfjm8bgH1460BA5K44Oobzv1FRAYq9Rgg291B8=";
28     })
29   ];
31   propagatedBuildInputs = [ django ];
33   nativeCheckInputs = [ dj-database-url ];
35   # Tests fail for Django >= 5.1.0
36   doCheck = lib.versionOlder django.version "5.1.0";
38   checkPhase = ''
39     ${python.interpreter} runtests.py
40   '';
42   pythonImportsCheck = [ "polymorphic" ];
44   meta = with lib; {
45     homepage = "https://github.com/django-polymorphic/django-polymorphic";
46     description = "Improved Django model inheritance with automatic downcasting";
47     license = licenses.bsd3;
48     maintainers = [ ];
49   };