~dricottone/huttese-apk

bddf4bc284a63004a0ffbb206a688d201b54cb5c — Drew DeVault 3 years ago 94175ce
py3-celery: fix more stupid fucking bullshit

I hate Celery so fucking much, it's a insult to good engineering
2 files changed, 90 insertions(+), 3 deletions(-)

M sr.ht/py3-celery/APKBUILD
M sr.ht/py3-celery/click.patch
M sr.ht/py3-celery/APKBUILD => sr.ht/py3-celery/APKBUILD +2 -2
@@ 2,7 2,7 @@
pkgname=py3-celery
_pyname=celery
pkgver=5.1.2
pkgrel=0
pkgrel=1
pkgdesc="Distributed Asyncronous Task Queue"
url="http://celeryproject.org"
arch="noarch"


@@ 39,5 39,5 @@ package() {

sha512sums="
c8f8d8dd4cc23a62ed3eea9b5388865993aee940730d4c672ae24c1b017466b0de6f422c7cb3b1bb2a4e33459a0d2447f9a42e59ee949fda56f3032298402a71  celery-5.1.2.tar.gz
cac49c37f28dc4d6daf9e2ae74dccdcf0c1dd47d690d2e1d7e356ad4dd915950d85c0f66367cde7d0244663f798a3014b776310e649e277c92239d05c5976e46  click.patch
8119f9d07b3b0fad35113bcefa2090368e68679f2f9f8b9719223d5125ec3bed7f7571e70a360fd5827fa5e5e0c7cf891b743d9d724d384d4cbc5ce46145d0b2  click.patch
"

M sr.ht/py3-celery/click.patch => sr.ht/py3-celery/click.patch +88 -1
@@ 1,7 1,7 @@
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] relaxed click version
Subject: [PATCH 1/4] relaxed click version

---
 requirements/default.txt | 4 ++--


@@ 22,3 22,90 @@ index afa9d16f25..b892226269 100644
+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)