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