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