Merge pull request #241249 from onny/celery-singleton

python3Packages.celery-singleton: init at 0.3.1
This commit is contained in:
Jonas Heinrich 2023-07-08 17:57:55 +02:00 committed by GitHub
commit ca79c9ba6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,76 @@
{ lib
, buildPythonPackage
, fetchpatch
, fetchFromGitHub
, poetry-core
, celery
, redis
, pytestCheckHook
, pytest-celery
}:
buildPythonPackage rec {
pname = "celery-singleton";
version = "0.3.1";
format = "pyproject";
src = fetchFromGitHub {
owner = "steinitzu";
repo = "celery-singleton";
rev = version;
hash = "sha256-fHlakxxjYIADELZdxIj6rvsZ/+1QfnKvAg3w5cdzvDc=";
};
postPatch = ''
# Disable coverage reporting in tests
substituteInPlace setup.cfg \
--replace "--cov" "" \
--replace "--no-cov-on-fail" ""
'';
patches = [
# chore(poetry): use poetry-core
# https://github.com/steinitzu/celery-singleton/pull/54
(fetchpatch {
name = "use-poetry-core.patch";
url = "https://github.com/steinitzu/celery-singleton/pull/54/commits/634a001c92a1dff1fae513fc95d733ea9b87e4cf.patch";
hash = "sha256-lXN4khwyL96pWyBS+iuSkGEkegv4HxYtym+6JUcPa94=";
})
];
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
celery
redis
];
checkInputs = [
pytestCheckHook
pytest-celery
];
pytestFlagsArray = [ "tests" ];
# Tests require a running Redis backend
disabledTests = [
"TestLock"
"TestUnlock"
"TestClear"
"TestSimpleTask"
"TestRaiseOnDuplicateConfig"
"TestUniqueOn"
];
pythonImportsCheck = [ "celery_singleton" ];
meta = with lib; {
description = "Seamlessly prevent duplicate executions of celery tasks";
homepage = "https://github.com/steinitzu/celery-singleton";
changelog = "https://github.com/steinitzu/celery-singleton/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ onny ];
};
}

View file

@ -1711,6 +1711,8 @@ self: super: with self; {
celery-redbeat = callPackage ../development/python-modules/celery-redbeat { };
celery-singleton = callPackage ../development/python-modules/celery-singleton { };
cement = callPackage ../development/python-modules/cement { };
cemm = callPackage ../development/python-modules/cemm { };