nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 setuptools,
7 django,
8 django-stubs-ext,
9 typing-extensions,
10 mysqlclient,
11 psycopg,
12 dj-database-url,
13 django-rq,
14 fakeredis,
15 pytestCheckHook,
16 pytest-django,
17 redisTestHook,
18}:
19
20buildPythonPackage rec {
21 pname = "django-tasks";
22 version = "0.11.0";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "RealOrangeOne";
27 repo = "django-tasks";
28 tag = version;
29 hash = "sha256-WU2TQa4FMEqtNtetH4qAyXqkrP/9PTw/K63MfUWEWGw=";
30 };
31
32 build-system = [
33 setuptools
34 ];
35
36 dependencies = [
37 django
38 django-stubs-ext
39 typing-extensions
40 ];
41
42 optional-dependencies = {
43 mysql = [
44 mysqlclient
45 ];
46 postgres = [
47 psycopg
48 ];
49 };
50
51 pythonImportsCheck = [ "django_tasks" ];
52
53 # redis hook does not support darwin
54 doCheck = !stdenv.hostPlatform.isDarwin;
55
56 nativeCheckInputs = [
57 django-rq
58 dj-database-url
59 fakeredis
60 pytestCheckHook
61 pytest-django
62 redisTestHook
63 ];
64
65 disabledTests = [
66 # AssertionError: Lists differ: [] != ['Starting worker for queues=default', ...
67 "test_verbose_logging"
68 # AssertionError: '' != 'Deleted 0 task result(s)'
69 "test_doesnt_prune_new_task"
70 # AssertionError: '' != 'Would delete 1 task result(s)'
71 "test_dry_run"
72 # AssertionError: '' != 'Deleted 1 task result(s)'
73 "test_prunes_tasks"
74 # AssertionError: 'Run maximum tasks (2)' not found in ''
75 "test_max_tasks"
76 # AssertionError: <django_tasks.backends.database.backend.DatabaseBackend object at 0x7ffff3fa3cd0> is not an instance of <class 'django_tasks.backends.immediate.ImmediateBackend'>
77 "test_uses_lib_tasks_by_default"
78 ];
79
80 preCheck = ''
81 export DJANGO_SETTINGS_MODULE="tests.settings"
82 '';
83
84 meta = {
85 description = "Reference implementation and backport of background workers and tasks in Django";
86 homepage = "https://github.com/RealOrangeOne/django-tasks";
87 changelog = "https://github.com/RealOrangeOne/django-tasks/releases/tag/${src.tag}";
88 license = lib.licenses.bsd3;
89 maintainers = with lib.maintainers; [ GaetanLepage ];
90 };
91}