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