forked from pool/python-celery
- Add relax-click.patch to fix requirements (boo#1189286) OBS-URL: https://build.opensuse.org/request/show/913346 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-celery?expand=0&rev=146
76 lines
2.7 KiB
Diff
76 lines
2.7 KiB
Diff
From ef026ea44f59e5d234c195c3ce73927f8323f9ee Mon Sep 17 00:00:00 2001
|
|
From: Thomas Grainger <tagrain@gmail.com>
|
|
Date: Tue, 20 Jul 2021 17:19:02 +0100
|
|
Subject: [PATCH] relaxed click version (#6861)
|
|
|
|
* relaxed click version
|
|
|
|
* fix get_default
|
|
|
|
* pre-check WorkersPool click.Choice type before calling super
|
|
|
|
https://github.com/pallets/click/issues/1898#issuecomment-841546735
|
|
|
|
* apply pre-commit run --all-files
|
|
|
|
Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
|
|
---
|
|
celery/bin/base.py | 4 ++--
|
|
celery/bin/worker.py | 4 ++++
|
|
requirements/default.txt | 4 ++--
|
|
3 files changed, 8 insertions(+), 4 deletions(-)
|
|
|
|
Index: celery-5.0.5/celery/bin/base.py
|
|
===================================================================
|
|
--- celery-5.0.5.orig/celery/bin/base.py
|
|
+++ celery-5.0.5/celery/bin/base.py
|
|
@@ -137,10 +137,10 @@ def handle_preload_options(f):
|
|
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."""
|
|
Index: celery-5.0.5/celery/bin/worker.py
|
|
===================================================================
|
|
--- celery-5.0.5.orig/celery/bin/worker.py
|
|
+++ celery-5.0.5/celery/bin/worker.py
|
|
@@ -11,6 +11,7 @@ from celery import concurrency
|
|
from celery.bin.base import (COMMA_SEPARATED_LIST, LOG_LEVEL,
|
|
CeleryDaemonCommand, CeleryOption,
|
|
handle_preload_options)
|
|
+from celery.concurrency.base import BasePool
|
|
from celery.platforms import (EX_FAILURE, EX_OK, detached,
|
|
maybe_drop_privileges)
|
|
from celery.utils.log import get_logger
|
|
@@ -44,6 +45,9 @@ class WorkersPool(click.Choice):
|
|
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
|
|
+
|
|
return concurrency.get_implementation(
|
|
value) or ctx.obj.app.conf.worker_pool
|
|
|
|
Index: celery-5.0.5/requirements/default.txt
|
|
===================================================================
|
|
--- celery-5.0.5.orig/requirements/default.txt
|
|
+++ celery-5.0.5/requirements/default.txt
|
|
@@ -2,7 +2,7 @@ pytz>dev
|
|
billiard>=3.6.3.0,<4.0
|
|
kombu>=5.0.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
|