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 David Chen committed Sep 10, 2018
1 parent a0afb32 commit 22214f4
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion celery/concurrency/asynpool.py
Expand Up @@ -35,7 +35,7 @@
from billiard import pool as _pool
from billiard.compat import buf_t, setblocking, isblocking
from billiard.queues import _SimpleQueue
from kombu.async import WRITE, ERR
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: 2 additions & 0 deletions celery/concurrency/eventlet.py
Expand Up @@ -2,6 +2,8 @@
"""Eventlet execution pool."""
from __future__ import absolute_import, unicode_literals
import sys

from kombu.asynchronous import timer as _timer # noqa
from kombu.five import monotonic

__all__ = ['TaskPool']
Expand Down
3 changes: 2 additions & 1 deletion celery/concurrency/gevent.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
"""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
try:
Expand Down
6 changes: 5 additions & 1 deletion celery/utils/timer2.py
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 @@ -14,6 +14,10 @@
from itertools import count
from time import sleep

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

from kombu.async.timer import Entry, Timer as Schedule, to_timestamp, logger
Expand Down
2 changes: 1 addition & 1 deletion celery/worker/autoscale.py
Expand Up @@ -15,7 +15,7 @@

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
7 changes: 4 additions & 3 deletions celery/worker/components.py
Expand Up @@ -5,9 +5,10 @@
import atexit
import warnings

from kombu.async import Hub as _Hub, 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
Expand Up @@ -16,7 +16,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 safe_repr, bytes_t
from kombu.utils.limits import TokenBucket
Expand Down
2 changes: 1 addition & 1 deletion celery/worker/consumer/gossip.py
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
Expand Up @@ -16,7 +16,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
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
@@ -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 22214f4

Please sign in to comment.