ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / django / 4.nix
blob935abb99c8db11a3ec18a970b3641b0f505ed314
1 { lib
2 , stdenv
3 , buildPythonPackage
4 , fetchPypi
5 , pythonOlder
6 , substituteAll
8 # build
9 , setuptools
11 # patched in
12 , fetchpatch
13 , geos
14 , gdal
15 , withGdal ? false
17 # propagated
18 , asgiref
19 , backports-zoneinfo
20 , sqlparse
22 # tests
23 , aiosmtpd
24 , argon2-cffi
25 , bcrypt
26 , docutils
27 , geoip2
28 , jinja2
29 , python-memcached
30 , numpy
31 , pillow
32 , pylibmc
33 , pymemcache
34 , python
35 , pytz
36 , pywatchman
37 , pyyaml
38 , redis
39 , selenium
40 , tblib
41 , tzdata
44 buildPythonPackage rec {
45   pname = "Django";
46   version = "4.1.3";
47   format = "pyproject";
49   disabled = pythonOlder "3.8";
51   src = fetchPypi {
52     inherit pname version;
53     hash = "sha256-Z4u/yGBOskbtVOIGPwdl8TsyGlBSa9yMsflD7af6MfE=";
54   };
56   patches = [
57     (substituteAll {
58       src = ./django_4_set_zoneinfo_dir.patch;
59       zoneinfo = tzdata + "/share/zoneinfo";
60     })
61   ] ++ lib.optionals withGdal [
62     (substituteAll {
63       src = ./django_4_set_geos_gdal_lib.patch;
64       geos = geos;
65       gdal = gdal;
66       extension = stdenv.hostPlatform.extensions.sharedLibrary;
67     })
68   ];
70   nativeBuildInputs = [
71     setuptools
72   ];
74   propagatedBuildInputs = [
75     asgiref
76     sqlparse
77   ] ++ lib.optionals (pythonOlder "3.9") [
78     backports-zoneinfo
79   ];
81   # Fails to import asgiref in ~200 tests
82   # ModuleNotFoundError: No module named 'asgiref'
83   doCheck = false;
85   checkInputs = [
86     aiosmtpd
87     argon2-cffi
88     asgiref
89     bcrypt
90     docutils
91     geoip2
92     jinja2
93     python-memcached
94     numpy
95     pillow
96     pylibmc
97     pymemcache
98     pytz
99     pywatchman
100     pyyaml
101     redis
102     selenium
103     tblib
104     tzdata
105   ];
107   checkPhase = ''
108     runHook preCheck
110     ${python.interpreter} tests/runtests.py
112     runHook postCheck
113   '';
115   meta = with lib; {
116     description = "A high-level Python Web framework that encourages rapid development and clean, pragmatic design.";
117     homepage = "https://www.djangoproject.com";
118     license = licenses.bsd3;
119     maintainers = with maintainers; [ hexa ];
120   };