1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 fetchPypi,
6 pythonRelaxDepsHook,
7 django,
8 funcy,
9 redis,
10 six,
11 pytestCheckHook,
12 pytest-django,
13 mock,
14 dill,
15 jinja2,
16 before-after,
17 pythonOlder,
18 nettools,
19 pkgs,
20}:
21
22buildPythonPackage rec {
23 pname = "django-cacheops";
24 version = "7.0.2";
25 format = "setuptools";
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchPypi {
30 inherit pname version;
31 hash = "sha256-d6N8c9f6z8cpk2XtZqEr56SH3XRd2GwdM8ouv9OzKHg=";
32 };
33
34 nativeBuildInputs = [ pythonRelaxDepsHook ];
35 pythonRelaxDeps = [ "funcy" ];
36
37 propagatedBuildInputs = [
38 django
39 funcy
40 redis
41 six
42 ];
43
44 __darwinAllowLocalNetworking = true;
45
46 nativeCheckInputs = [
47 pytestCheckHook
48 pytest-django
49 mock
50 dill
51 jinja2
52 before-after
53 nettools
54 pkgs.redis
55 ];
56
57 preCheck = ''
58 redis-server &
59 REDIS_PID=$!
60 while ! redis-cli --scan ; do
61 echo waiting for redis to be ready
62 sleep 1
63 done
64 '';
65
66 postCheck = ''
67 kill $REDIS_PID
68 '';
69
70 DJANGO_SETTINGS_MODULE = "tests.settings";
71
72 meta = with lib; {
73 description = "A slick ORM cache with automatic granular event-driven invalidation for Django";
74 homepage = "https://github.com/Suor/django-cacheops";
75 changelog = "https://github.com/Suor/django-cacheops/blob/${version}/CHANGELOG";
76 license = licenses.bsd3;
77 maintainers = with maintainers; [ onny ];
78 };
79}