Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / celery-singleton / default.nix
blobbb3ac446a60058e374ccb9090da0ed05d11d78ce
1 { lib
2 , buildPythonPackage
3 , fetchpatch
4 , fetchFromGitHub
5 , poetry-core
6 , celery
7 , redis
8 , pytestCheckHook
9 , pytest-celery
12 buildPythonPackage rec {
13   pname = "celery-singleton";
14   version = "0.3.1";
15   format = "pyproject";
17   src = fetchFromGitHub {
18     owner = "steinitzu";
19     repo = "celery-singleton";
20     rev = version;
21     hash = "sha256-fHlakxxjYIADELZdxIj6rvsZ/+1QfnKvAg3w5cdzvDc=";
22   };
24   postPatch = ''
25     # Disable coverage reporting in tests
26     substituteInPlace setup.cfg \
27       --replace "--cov" "" \
28       --replace "--no-cov-on-fail" ""
29   '';
31   patches = [
32     # chore(poetry): use poetry-core
33     # https://github.com/steinitzu/celery-singleton/pull/54
34     (fetchpatch {
35       name = "use-poetry-core.patch";
36       url = "https://github.com/steinitzu/celery-singleton/pull/54/commits/634a001c92a1dff1fae513fc95d733ea9b87e4cf.patch";
37       hash = "sha256-lXN4khwyL96pWyBS+iuSkGEkegv4HxYtym+6JUcPa94=";
38     })
39   ];
41   nativeBuildInputs = [
42     poetry-core
43   ];
45   propagatedBuildInputs = [
46     celery
47     redis
48   ];
50   checkInputs = [
51     pytestCheckHook
52     pytest-celery
53   ];
55   pytestFlagsArray = [ "tests" ];
57   # Tests require a running Redis backend
58   disabledTests = [
59     "TestLock"
60     "TestUnlock"
61     "TestClear"
62     "TestSimpleTask"
63     "TestRaiseOnDuplicateConfig"
64     "TestUniqueOn"
65   ];
67   pythonImportsCheck = [ "celery_singleton" ];
69   meta = with lib; {
70     description = "Seamlessly prevent duplicate executions of celery tasks";
71     homepage = "https://github.com/steinitzu/celery-singleton";
72     changelog = "https://github.com/steinitzu/celery-singleton/blob/${src.rev}/CHANGELOG.md";
73     license = licenses.mit;
74     maintainers = with maintainers; [ onny ];
75   };