Skip to content

Commit

Permalink
[WIP] import from asynchronous instead of async and fix python 3.7 co…
Browse files Browse the repository at this point in the history
…mpat issues (celery#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
  • Loading branch information
auvipy authored and Omer Katz committed May 21, 2018
1 parent 28dbb6b commit 1a941f9
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion celery/concurrency/asynpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion celery/concurrency/eventlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion celery/concurrency/gevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions celery/utils/timer2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion celery/worker/autoscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions celery/worker/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion celery/worker/consumer/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion celery/worker/consumer/gossip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion celery/worker/heartbeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion celery/worker/strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/default.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1a941f9

Please sign in to comment.