1{
2 lib,
3 stdenv,
4 arrow,
5 blessed,
6 buildPythonPackage,
7 croniter,
8 django,
9 django-picklefield,
10 django-redis,
11 fetchFromGitHub,
12 future,
13 pkgs,
14 poetry-core,
15 pytest-django,
16 pytest-mock,
17 pytestCheckHook,
18 pythonOlder,
19 redis,
20 setuptools,
21}:
22
23buildPythonPackage rec {
24 pname = "django-q";
25 version = "1.3.9";
26 pyproject = true;
27
28 disabled = pythonOlder "3.6";
29
30 src = fetchFromGitHub {
31 owner = "Koed00";
32 repo = "django-q";
33 rev = "refs/tags/v${version}";
34 hash = "sha256-gFSrAl3QGoJEJfvTTvLQgViPPjeJ6BfvgEwgLLo+uAA=";
35 };
36
37 # fixes empty version string
38 # analog to https://github.com/NixOS/nixpkgs/pull/171200
39 patches = [ ./pep-621.patch ];
40
41 nativeBuildInputs = [
42 poetry-core
43 setuptools
44 ];
45
46 propagatedBuildInputs = [
47 django-picklefield
48 arrow
49 blessed
50 django
51 future
52 ];
53
54 nativeCheckInputs = [
55 croniter
56 django-redis
57 pytest-django
58 pytest-mock
59 pytestCheckHook
60 ] ++ django-redis.optional-dependencies.hiredis;
61
62 pythonImportsCheck = [ "django_q" ];
63
64 preCheck = ''
65 ${pkgs.redis}/bin/redis-server &
66 REDIS_PID=$!
67 '';
68
69 postCheck = ''
70 kill $REDIS_PID
71 '';
72
73 # don't bother with two more servers to test
74 disabledTests = [
75 "test_disque"
76 "test_mongo"
77 ];
78
79 doCheck = !stdenv.isDarwin;
80
81 meta = with lib; {
82 description = "A multiprocessing distributed task queue for Django";
83 homepage = "https://django-q.readthedocs.org";
84 changelog = "https://github.com/Koed00/django-q/releases/tag/v${version}";
85 license = licenses.mit;
86 maintainers = with maintainers; [ gador ];
87 # django-q is unmaintained at the moment
88 # https://github.com/Koed00/django-q/issues/733
89 broken = lib.versionAtLeast redis.version "5";
90 };
91}