ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / django-redis / default.nix
blob1ad52e22d0ffe20f523ae4deb3fae95198dfab96
1 { lib
2 , fetchFromGitHub
3 , pythonOlder
4 , buildPythonPackage
6 # propagated
7 , django
8 , hiredis
9 , lz4
10 , msgpack
11 , redis
13 # testing
14 , pkgs
15 , pytest-django
16 , pytest-mock
17 , pytestCheckHook
20 let
21   pname = "django-redis";
22   version = "5.2.0";
24 buildPythonPackage {
25   inherit pname version;
26   format = "setuptools";
27   disabled = pythonOlder "3.6";
29   src = fetchFromGitHub {
30     owner = "jazzband";
31     repo = "django-redis";
32     rev = version;
33     sha256 = "sha256-e8wCgfxBT+WKFY4H83CTMirTpQym3QAoeWnXbRCDO90=";
34   };
36   postPatch = ''
37     sed -i '/-cov/d' setup.cfg
38   '';
40   propagatedBuildInputs = [
41     django
42     hiredis
43     lz4
44     msgpack
45     redis
46   ];
48   pythonImportsCheck = [
49     "django_redis"
50   ];
52   DJANGO_SETTINGS_MODULE = "tests.settings.sqlite";
54   preCheck = ''
55     ${pkgs.redis}/bin/redis-server &
56     REDIS_PID=$!
57   '';
59   postCheck = ''
60     kill $REDIS_PID
61   '';
63   checkInputs = [
64     pytest-django
65     pytest-mock
66     pytestCheckHook
67   ];
69   disabledTests = [
70     # ModuleNotFoundError: No module named 'test_cache_options'
71     "test_custom_key_function"
72     # ModuleNotFoundError: No module named 'test_client'
73     "test_delete_pattern_calls_get_client_given_no_client"
74     "test_delete_pattern_calls_make_pattern"
75     "test_delete_pattern_calls_scan_iter_with_count_if_itersize_given"
76     "test_delete_pattern_calls_scan_iter_with_count_if_itersize_given"
77     "test_delete_pattern_calls_scan_iter"
78     "test_delete_pattern_calls_delete_for_given_keys"
79   ];
81   meta = with lib; {
82     description = "Full featured redis cache backend for Django";
83     homepage = "https://github.com/jazzband/django-redis";
84     license = licenses.bsd3;
85     maintainers = with maintainers; [ hexa ];
86   };