1{
2 lib,
3 arrow,
4 blessed,
5 bson,
6 buildPythonPackage,
7 croniter,
8 django,
9 django-picklefield,
10 django-redis,
11 fetchFromGitHub,
12 hiredis,
13 poetry-core,
14 pytest-django,
15 pytestCheckHook,
16 redisTestHook,
17 stdenv,
18}:
19
20buildPythonPackage rec {
21 pname = "django-q2";
22 version = "1.8.0";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "django-q2";
27 repo = "django-q2";
28 tag = "v${version}";
29 hash = "sha256-SmTiplQzmMiK6xBs1TDikHE1ChI2twqemaP/ID6kvc4=";
30 };
31
32 postPatch = ''
33 substituteInPlace django_q/tests/settings.py \
34 --replace-fail "HiredisParser" "_HiredisParser"
35 '';
36
37 build-system = [
38 poetry-core
39 ];
40
41 dependencies = [
42 arrow
43 bson # required for mongodb but undocumented
44 django
45 django-picklefield
46 ];
47
48 nativeCheckInputs = [
49 blessed
50 croniter
51 django-redis
52 hiredis
53 pytest-django
54 pytestCheckHook
55 redisTestHook
56 ];
57
58 pythonImportsCheck = [ "django_q" ];
59
60 env = {
61 MONGO_HOST = "127.0.0.1";
62 REDIS_HOST = "127.0.0.1";
63 };
64
65 disabledTests = [
66 # requires a running mongodb
67 "test_mongo"
68 ]
69 ++ lib.optionals stdenv.hostPlatform.isDarwin [
70 # fails with an assertion
71 "test_max_rss"
72 "test_recycle"
73 # cannot connect to redis
74 "test_broker"
75 "test_custom"
76 "test_redis"
77 "test_redis_connection"
78 ];
79
80 disabledTestPaths = [
81 "django_q/tests/test_commands.py"
82 ];
83
84 pytestFlags = [ "-vv" ];
85
86 __darwinAllowLocalNetworking = true;
87
88 meta = {
89 description = "Multiprocessing distributed task queue for Django based on Django-Q";
90 homepage = "https://github.com/django-q2/django-q2";
91 changelog = "https://github.com/django-q2/django-q2/releases/tag/v${version}";
92 license = lib.licenses.mit;
93 maintainers = with lib.maintainers; [ SuperSandro2000 ];
94 };
95}