1{
2 lib,
3 stdenv,
4 billiard,
5 buildPythonPackage,
6 click-didyoumean,
7 click-plugins,
8 click-repl,
9 click,
10 fetchPypi,
11 google-cloud-storage,
12 kombu,
13 moto,
14 msgpack,
15 nixosTests,
16 pymongo,
17 redis,
18 pytest-celery,
19 pytest-click,
20 pytest-subtests,
21 pytest-timeout,
22 pytest-xdist,
23 pytestCheckHook,
24 python-dateutil,
25 pythonOlder,
26 pyyaml,
27 setuptools,
28 tzdata,
29 vine,
30}:
31
32buildPythonPackage rec {
33 pname = "celery";
34 version = "5.4.0";
35 pyproject = true;
36
37 disabled = pythonOlder "3.8";
38
39 src = fetchPypi {
40 inherit pname version;
41 hash = "sha256-UEoZFA6NMCnVrK2IMwxUHUw/ZMeJ2F+UdWdi2Lyn5wY=";
42 };
43
44 build-system = [ setuptools ];
45
46 dependencies = [
47 billiard
48 click
49 click-didyoumean
50 click-plugins
51 click-repl
52 kombu
53 python-dateutil
54 tzdata
55 vine
56 ];
57
58 optional-dependencies = {
59 gcs = [ google-cloud-storage ];
60 mongodb = [ pymongo ];
61 msgpack = [ msgpack ];
62 yaml = [ pyyaml ];
63 redis = [ redis ];
64 };
65
66 nativeCheckInputs = [
67 moto
68 pytest-celery
69 pytest-click
70 pytest-subtests
71 pytest-timeout
72 pytest-xdist
73 pytestCheckHook
74 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
75
76 disabledTestPaths = [
77 # test_eventlet touches network
78 "t/unit/concurrency/test_eventlet.py"
79 # test_multi tries to create directories under /var
80 "t/unit/bin/test_multi.py"
81 "t/unit/apps/test_multi.py"
82 # Test requires moto<5
83 "t/unit/backends/test_s3.py"
84 ];
85
86 disabledTests =
87 [
88 "msgpack"
89 "test_check_privileges_no_fchown"
90 # seems to only fail on higher core counts
91 # AssertionError: assert 3 == 0
92 "test_setup_security_disabled_serializers"
93 # Test is flaky, especially on hydra
94 "test_ready"
95 # Tests fail with pytest-xdist
96 "test_itercapture_limit"
97 "test_stamping_headers_in_options"
98 "test_stamping_with_replace"
99 ]
100 ++ lib.optionals stdenv.hostPlatform.isDarwin [
101 # Too many open files on hydra
102 "test_cleanup"
103 "test_with_autoscaler_file_descriptor_safety"
104 "test_with_file_descriptor_safety"
105 ];
106
107 pythonImportsCheck = [ "celery" ];
108
109 passthru.tests = {
110 inherit (nixosTests) sourcehut;
111 };
112
113 meta = with lib; {
114 description = "Distributed task queue";
115 homepage = "https://github.com/celery/celery/";
116 changelog = "https://github.com/celery/celery/releases/tag/v${version}";
117 license = licenses.bsd3;
118 maintainers = with maintainers; [ fab ];
119 mainProgram = "celery";
120 };
121}