1{
2 lib,
3 buildPythonPackage,
4 fetchpatch,
5 fetchFromGitHub,
6 poetry-core,
7 celery,
8 redis,
9 pytestCheckHook,
10 pytest-celery,
11 pytest-cov-stub,
12}:
13
14buildPythonPackage rec {
15 pname = "celery-singleton";
16 version = "0.3.1";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "steinitzu";
21 repo = "celery-singleton";
22 rev = version;
23 hash = "sha256-fHlakxxjYIADELZdxIj6rvsZ/+1QfnKvAg3w5cdzvDc=";
24 };
25
26 patches = [
27 # chore(poetry): use poetry-core
28 # https://github.com/steinitzu/celery-singleton/pull/54
29 (fetchpatch {
30 name = "use-poetry-core.patch";
31 url = "https://github.com/steinitzu/celery-singleton/pull/54/commits/634a001c92a1dff1fae513fc95d733ea9b87e4cf.patch";
32 hash = "sha256-lXN4khwyL96pWyBS+iuSkGEkegv4HxYtym+6JUcPa94=";
33 })
34 ];
35
36 build-system = [ poetry-core ];
37
38 dependencies = [
39 celery
40 redis
41 ];
42
43 checkInputs = [
44 pytestCheckHook
45 pytest-celery
46 pytest-cov-stub
47 ];
48
49 enabledTestPaths = [ "tests" ];
50
51 # Tests require a running Redis backend
52 disabledTests = [
53 "TestLock"
54 "TestUnlock"
55 "TestClear"
56 "TestSimpleTask"
57 "TestRaiseOnDuplicateConfig"
58 "TestUniqueOn"
59 ];
60
61 pythonImportsCheck = [ "celery_singleton" ];
62
63 meta = with lib; {
64 description = "Seamlessly prevent duplicate executions of celery tasks";
65 homepage = "https://github.com/steinitzu/celery-singleton";
66 changelog = "https://github.com/steinitzu/celery-singleton/blob/${src.rev}/CHANGELOG.md";
67 license = licenses.mit;
68 maintainers = with maintainers; [ onny ];
69 };
70}