From 1a941f97ad9f19fe86c241072d21d1e3e6e19a73 Mon Sep 17 00:00:00 2001 From: Asif Saifuddin Auvi Date: Mon, 21 May 2018 12:24:42 +0600 Subject: [PATCH] [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 --- celery/concurrency/asynpool.py | 2 +- celery/concurrency/eventlet.py | 2 +- celery/concurrency/gevent.py | 2 +- celery/utils/timer2.py | 8 ++++---- celery/worker/autoscale.py | 2 +- celery/worker/components.py | 8 ++++---- celery/worker/consumer/consumer.py | 2 +- celery/worker/consumer/gossip.py | 2 +- celery/worker/heartbeat.py | 2 +- celery/worker/strategy.py | 2 +- requirements/default.txt | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/celery/concurrency/asynpool.py b/celery/concurrency/asynpool.py index dbf2cc2d696..05c925a5438 100644 --- a/celery/concurrency/asynpool.py +++ b/celery/concurrency/asynpool.py @@ -34,7 +34,7 @@ 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 diff --git a/celery/concurrency/eventlet.py b/celery/concurrency/eventlet.py index b44dc515d30..2befa56cdde 100644 --- a/celery/concurrency/eventlet.py +++ b/celery/concurrency/eventlet.py @@ -4,7 +4,7 @@ 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 diff --git a/celery/concurrency/gevent.py b/celery/concurrency/gevent.py index 4426f3b3d69..b940605aabd 100644 --- a/celery/concurrency/gevent.py +++ b/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 diff --git a/celery/utils/timer2.py b/celery/utils/timer2.py index ba7dc406982..58de4ac278b 100644 --- a/celery/utils/timer2.py +++ b/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 @@ 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 diff --git a/celery/worker/autoscale.py b/celery/worker/autoscale.py index a5b21543347..1b5d758b5cb 100644 --- a/celery/worker/autoscale.py +++ b/celery/worker/autoscale.py @@ -14,7 +14,7 @@ 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 diff --git a/celery/worker/components.py b/celery/worker/components.py index 7995ee1017c..1b2d12bf06a 100644 --- a/celery/worker/components.py +++ b/celery/worker/components.py @@ -5,10 +5,10 @@ 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 diff --git a/celery/worker/consumer/consumer.py b/celery/worker/consumer/consumer.py index 41e16f31b5f..be6046d2b0b 100644 --- a/celery/worker/consumer/consumer.py +++ b/celery/worker/consumer/consumer.py @@ -15,7 +15,7 @@ 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 diff --git a/celery/worker/consumer/gossip.py b/celery/worker/consumer/gossip.py index de1d45e73ff..5dca98d1bff 100644 --- a/celery/worker/consumer/gossip.py +++ b/celery/worker/consumer/gossip.py @@ -7,7 +7,7 @@ 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 diff --git a/celery/worker/heartbeat.py b/celery/worker/heartbeat.py index 520b7601375..8ce4acc7ff5 100644 --- a/celery/worker/heartbeat.py +++ b/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 diff --git a/celery/worker/strategy.py b/celery/worker/strategy.py index 16bea7f5f6a..2e65f743238 100644 --- a/celery/worker/strategy.py +++ b/celery/worker/strategy.py @@ -4,7 +4,7 @@ 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 diff --git a/requirements/default.txt b/requirements/default.txt index fc5d29e6b08..11d527f4ff4 100644 --- a/requirements/default.txt +++ b/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