Browse Source

[WIP] import from asynchronous instead of async and fix python 3.7 compat issues (#4679)

* imported from renamed asynchronous module of kombu

* imported from renamed asynchronous module of kombu

* imported from renamed asynchronous module of kombu in utils timer2

* update minimum kombu version
Asif Saifuddin Auvi 6 years ago
parent
commit
1a941f97ad

+ 1 - 1
celery/concurrency/asynpool.py

@@ -34,7 +34,7 @@ from billiard import pool as _pool
 from billiard.compat import buf_t, isblocking, setblocking
 from billiard.pool import ACK, NACK, RUN, TERMINATE, WorkersJoined
 from billiard.queues import _SimpleQueue
-from kombu.async import ERR, WRITE
+from kombu.asynchronous import ERR, WRITE
 from kombu.serialization import pickle as _pickle
 from kombu.utils.eventio import SELECT_BAD_FD
 from kombu.utils.functional import fxrange

+ 1 - 1
celery/concurrency/eventlet.py

@@ -4,7 +4,7 @@ from __future__ import absolute_import, unicode_literals
 
 import sys
 
-from kombu.async import timer as _timer  # noqa
+from kombu.asynchronous import timer as _timer  # noqa
 from kombu.five import monotonic
 
 from celery import signals  # noqa

+ 1 - 1
celery/concurrency/gevent.py

@@ -2,7 +2,7 @@
 """Gevent execution pool."""
 from __future__ import absolute_import, unicode_literals
 
-from kombu.async import timer as _timer
+from kombu.asynchronous import timer as _timer
 from kombu.five import monotonic
 
 from . import base

+ 4 - 4
celery/utils/timer2.py

@@ -3,7 +3,7 @@
 
 .. note::
     This is used for the thread-based worker only,
-    not for amqp/redis/sqs/qpid where :mod:`kombu.async.timer` is used.
+    not for amqp/redis/sqs/qpid where :mod:`kombu.asynchronous.timer` is used.
 """
 from __future__ import absolute_import, print_function, unicode_literals
 
@@ -13,9 +13,9 @@ import threading
 from itertools import count
 from time import sleep
 
-from kombu.async.timer import Entry
-from kombu.async.timer import Timer as Schedule
-from kombu.async.timer import logger, to_timestamp
+from kombu.asynchronous.timer import Entry
+from kombu.asynchronous.timer import Timer as Schedule
+from kombu.asynchronous.timer import logger, to_timestamp
 
 from celery.five import THREAD_TIMEOUT_MAX
 

+ 1 - 1
celery/worker/autoscale.py

@@ -14,7 +14,7 @@ import os
 import threading
 from time import sleep
 
-from kombu.async.semaphore import DummyLock
+from kombu.asynchronous.semaphore import DummyLock
 
 from celery import bootsteps
 from celery.five import monotonic

+ 4 - 4
celery/worker/components.py

@@ -5,10 +5,10 @@ from __future__ import absolute_import, unicode_literals
 import atexit
 import warnings
 
-from kombu.async import Hub as _Hub
-from kombu.async import get_event_loop, set_event_loop
-from kombu.async.semaphore import DummyLock, LaxBoundedSemaphore
-from kombu.async.timer import Timer as _Timer
+from kombu.asynchronous import Hub as _Hub
+from kombu.asynchronous import get_event_loop, set_event_loop
+from kombu.asynchronous.semaphore import DummyLock, LaxBoundedSemaphore
+from kombu.asynchronous.timer import Timer as _Timer
 
 from celery import bootsteps
 from celery._state import _set_task_join_will_block

+ 1 - 1
celery/worker/consumer/consumer.py

@@ -15,7 +15,7 @@ from time import sleep
 
 from billiard.common import restart_state
 from billiard.exceptions import RestartFreqExceeded
-from kombu.async.semaphore import DummyLock
+from kombu.asynchronous.semaphore import DummyLock
 from kombu.utils.compat import _detect_environment
 from kombu.utils.encoding import bytes_t, safe_repr
 from kombu.utils.limits import TokenBucket

+ 1 - 1
celery/worker/consumer/gossip.py

@@ -7,7 +7,7 @@ from heapq import heappush
 from operator import itemgetter
 
 from kombu import Consumer
-from kombu.async.semaphore import DummyLock
+from kombu.asynchronous.semaphore import DummyLock
 
 from celery import bootsteps
 from celery.five import values

+ 1 - 1
celery/worker/heartbeat.py

@@ -18,7 +18,7 @@ class Heart(object):
     """Timer sending heartbeats at regular intervals.
 
     Arguments:
-        timer (kombu.async.timer.Timer): Timer to use.
+        timer (kombu.asynchronous.timer.Timer): Timer to use.
         eventer (celery.events.EventDispatcher): Event dispatcher
             to use.
         interval (float): Time in seconds between sending

+ 1 - 1
celery/worker/strategy.py

@@ -4,7 +4,7 @@ from __future__ import absolute_import, unicode_literals
 
 import logging
 
-from kombu.async.timer import to_timestamp
+from kombu.asynchronous.timer import to_timestamp
 from kombu.five import buffer_t
 
 from celery.exceptions import InvalidTaskError

+ 1 - 1
requirements/default.txt

@@ -1,3 +1,3 @@
 pytz>dev
 billiard>=3.5.0.2,<3.6.0
-kombu>=4.0.2,<5.0
+kombu>=4.2.0,<5.0