python312Packages.dash-renderer: remove (#369714)
[NixPkgs.git] / pkgs / development / python-modules / django-redis / default.nix
blob6f0bd8ee34d09310ec0545d2185519e909178f1a
2   lib,
3   fetchFromGitHub,
4   pythonOlder,
5   buildPythonPackage,
6   setuptools,
8   # propagated
9   django,
10   hiredis,
11   lz4,
12   msgpack,
13   redis,
15   # testing
16   pkgs,
17   pytest-cov-stub,
18   pytest-django,
19   pytest-mock,
20   pytestCheckHook,
23 buildPythonPackage rec {
24   pname = "django-redis";
25   version = "5.4.0";
26   pyproject = true;
28   disabled = pythonOlder "3.6";
30   src = fetchFromGitHub {
31     owner = "jazzband";
32     repo = "django-redis";
33     tag = version;
34     hash = "sha256-m7z3c7My24vrSSnyfDQ/LlWhy7pV4U0L8LATMvkfczc=";
35   };
37   build-system = [ setuptools ];
39   propagatedBuildInputs = [
40     django
41     lz4
42     msgpack
43     redis
44   ];
46   optional-dependencies = {
47     hiredis = [ redis ] ++ redis.optional-dependencies.hiredis;
48   };
50   pythonImportsCheck = [ "django_redis" ];
52   preCheck = ''
53     export DJANGO_SETTINGS_MODULE=tests.settings.sqlite
55     ${pkgs.redis}/bin/redis-server &
56     REDIS_PID=$!
57   '';
59   postCheck = ''
60     kill $REDIS_PID
61   '';
63   nativeCheckInputs = [
64     pytest-cov-stub
65     pytest-django
66     pytest-mock
67     pytestCheckHook
68   ] ++ lib.flatten (lib.attrValues optional-dependencies);
70   pytestFlagsArray = [
71     "-W"
72     "ignore::DeprecationWarning"
73   ];
75   disabledTests = [
76     # ModuleNotFoundError: No module named 'test_cache_options'
77     "test_custom_key_function"
78     # ModuleNotFoundError: No module named 'test_client'
79     "test_delete_pattern_calls_delete_for_given_keys"
80     "test_delete_pattern_calls_get_client_given_no_client"
81     "test_delete_pattern_calls_make_pattern"
82     "test_delete_pattern_calls_pipeline_delete_and_execute"
83     "test_delete_pattern_calls_scan_iter"
84     "test_delete_pattern_calls_scan_iter_with_count_if_itersize_given"
85   ];
87   __darwinAllowLocalNetworking = true;
89   meta = with lib; {
90     description = "Full featured redis cache backend for Django";
91     homepage = "https://github.com/jazzband/django-redis";
92     changelog = "https://github.com/jazzband/django-redis/releases/tag/${version}";
93     license = licenses.bsd3;
94     maintainers = with maintainers; [ hexa ];
95   };