From 59cdf70aba5029d4403d493456874036735f79bd Mon Sep 17 00:00:00 2001
From: Asif Saif Uddin <auvipy@gmail.com>
Date: Thu, 3 Jun 2021 20:16:17 +0600
Subject: [PATCH 1/4] relaxed click version
---
requirements/default.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/requirements/default.txt b/requirements/default.txt
index afa9d16f25..b892226269 100644
--- a/requirements/default.txt
+++ b/requirements/default.txt
@@ -2,8 +2,8 @@ pytz>dev
billiard>=3.6.4.0,<4.0
kombu>=5.1.0,<6.0
vine>=5.0.0,<6.0
-click>=7.0,<8.0
+click>=8.0,<9.0
click-didyoumean>=0.0.3
-click-repl>=0.1.6
+click-repl>=0.2.0
click-plugins>=1.1.1
setuptools
From 23956d06524b5afe319ffa89ed126aff0891d88c Mon Sep 17 00:00:00 2001
From: Thomas Grainger <tagrain@gmail.com>
Date: Mon, 19 Jul 2021 11:26:04 +0100
Subject: [PATCH 2/4] fix get_default
---
celery/bin/base.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/celery/bin/base.py b/celery/bin/base.py
index 0eba53e1ce..95af1a8931 100644
--- a/celery/bin/base.py
+++ b/celery/bin/base.py
@@ -138,10 +138,10 @@ def caller(ctx, *args, **kwargs):
class CeleryOption(click.Option):
"""Customized option for Celery."""
- def get_default(self, ctx):
+ def get_default(self, ctx, *args, **kwargs):
if self.default_value_from_context:
self.default = ctx.obj[self.default_value_from_context]
- return super().get_default(ctx)
+ return super().get_default(ctx, *args, **kwargs)
def __init__(self, *args, **kwargs):
"""Initialize a Celery option."""
From 61116089965e3eaa37d613bf12bc47d2f5fe1b07 Mon Sep 17 00:00:00 2001
From: Thomas Grainger <tagrain@gmail.com>
Date: Mon, 19 Jul 2021 11:53:58 +0100
Subject: [PATCH 3/4] pre-check WorkersPool click.Choice type before calling
super
https://github.com/pallets/click/issues/1898#issuecomment-841546735
---
celery/bin/worker.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/celery/bin/worker.py b/celery/bin/worker.py
index eecd8743ab..9db7f85d66 100644
--- a/celery/bin/worker.py
+++ b/celery/bin/worker.py
@@ -8,6 +8,7 @@
from click.types import StringParamType
from celery import concurrency
+from celery.concurrency.base import BasePool
from celery.bin.base import (COMMA_SEPARATED_LIST, LOG_LEVEL,
CeleryDaemonCommand, CeleryOption,
handle_preload_options)
@@ -45,6 +46,9 @@ def __init__(self):
def convert(self, value, param, ctx):
# Pools like eventlet/gevent needs to patch libs as early
# as possible.
+ if isinstance(value, type) and issubclass(value, BasePool):
+ return value
+
value = super().convert(value, param, ctx)
worker_pool = ctx.obj.app.conf.worker_pool
if value == 'prefork' and worker_pool:
From bffa201acc966c59ca40c1e3e7f39d21630f3c96 Mon Sep 17 00:00:00 2001
From: Thomas Grainger <tagrain@gmail.com>
Date: Tue, 20 Jul 2021 09:16:03 +0100
Subject: [PATCH 4/4] apply pre-commit run --all-files
---
celery/bin/worker.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/celery/bin/worker.py b/celery/bin/worker.py
index 9db7f85d66..68a0d11724 100644
--- a/celery/bin/worker.py
+++ b/celery/bin/worker.py
@@ -8,10 +8,10 @@
from click.types import StringParamType
from celery import concurrency
-from celery.concurrency.base import BasePool
from celery.bin.base import (COMMA_SEPARATED_LIST, LOG_LEVEL,
CeleryDaemonCommand, CeleryOption,
handle_preload_options)
+from celery.concurrency.base import BasePool
from celery.exceptions import SecurityError
from celery.platforms import (EX_FAILURE, EX_OK, detached,
maybe_drop_privileges)