From 22eba29948f8657be440295c342434e464d6c0a0 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Wed, 2 Mar 2016 13:50:38 -0800 Subject: [PATCH] Use vine for promises --- celery/app/base.py | 2 +- celery/canvas.py | 2 +- celery/concurrency/asynpool.py | 3 ++- celery/result.py | 2 +- celery/tests/app/test_app.py | 2 +- celery/utils/functional.py | 2 +- celery/worker/consumer/consumer.py | 2 +- docs/conf.py | 1 + requirements/dev.txt | 3 ++- 9 files changed, 11 insertions(+), 8 deletions(-) diff --git a/celery/app/base.py b/celery/app/base.py index f3816ac0e..cd8c250ac 100644 --- a/celery/app/base.py +++ b/celery/app/base.py @@ -16,11 +16,11 @@ from collections import defaultdict, deque from operator import attrgetter from functools import wraps -from amqp import starpromise from kombu import pools from kombu.clocks import LamportClock from kombu.common import oid_from from kombu.utils import cached_property, register_after_fork, uuid +from vine import starpromise from celery import platforms from celery import signals diff --git a/celery/canvas.py b/celery/canvas.py index db170422c..f01c12b4f 100644 --- a/celery/canvas.py +++ b/celery/canvas.py @@ -20,8 +20,8 @@ from functools import partial as _partial, reduce from operator import itemgetter from itertools import chain as _chain -from amqp.promise import barrier from kombu.utils import cached_property, fxrange, reprcall, uuid +from vine import barrier from celery._state import current_app from celery.local import try_import diff --git a/celery/concurrency/asynpool.py b/celery/concurrency/asynpool.py index ae73567f0..31a815019 100644 --- a/celery/concurrency/asynpool.py +++ b/celery/concurrency/asynpool.py @@ -33,7 +33,6 @@ from pickle import HIGHEST_PROTOCOL from time import sleep from weakref import WeakValueDictionary, ref -from amqp import promise from billiard.pool import RUN, TERMINATE, ACK, NACK, WorkersJoined from billiard import pool as _pool from billiard.compat import buf_t, setblocking, isblocking @@ -42,6 +41,8 @@ from kombu.async import READ, WRITE, ERR from kombu.serialization import pickle as _pickle from kombu.utils import fxrange from kombu.utils.eventio import SELECT_BAD_FD +from vine import promise + from celery.five import Counter, items, values from celery.utils.functional import noop from celery.utils.log import get_logger diff --git a/celery/result.py b/celery/result.py index d4aae59bb..1efde9ddd 100644 --- a/celery/result.py +++ b/celery/result.py @@ -14,8 +14,8 @@ from collections import OrderedDict, deque from contextlib import contextmanager from copy import copy -from amqp.promise import Thenable, promise from kombu.utils import cached_property +from vine import Thenable, promise from . import current_app from . import states diff --git a/celery/tests/app/test_app.py b/celery/tests/app/test_app.py index 7a8a415a2..70fe7351c 100644 --- a/celery/tests/app/test_app.py +++ b/celery/tests/app/test_app.py @@ -7,7 +7,7 @@ import itertools from copy import deepcopy from pickle import loads, dumps -from amqp import promise +from vine import promise from celery import Celery from celery import shared_task, current_app diff --git a/celery/utils/functional.py b/celery/utils/functional.py index c691d45a3..0084f5dd4 100644 --- a/celery/utils/functional.py +++ b/celery/utils/functional.py @@ -19,10 +19,10 @@ except ImportError: # Py2 from inspect import isfunction, getargspec # noqa from itertools import chain, islice -from amqp import promise from kombu.utils.functional import ( dictfilter, lazy, maybe_evaluate, is_list, maybe_list, ) +from vine import promise from celery.five import UserDict, UserList, keys, range diff --git a/celery/worker/consumer/consumer.py b/celery/worker/consumer/consumer.py index 41ae346c1..ea2d93e96 100644 --- a/celery/worker/consumer/consumer.py +++ b/celery/worker/consumer/consumer.py @@ -17,7 +17,6 @@ import os from collections import defaultdict from time import sleep -from amqp.promise import ppartial, promise from billiard.common import restart_state from billiard.exceptions import RestartFreqExceeded from kombu.async.semaphore import DummyLock @@ -25,6 +24,7 @@ from kombu.five import buffer_t, items from kombu.syn import _detect_environment from kombu.utils.encoding import safe_repr, bytes_t from kombu.utils.limits import TokenBucket +from vine import ppartial, promise from celery import bootsteps from celery import signals diff --git a/docs/conf.py b/docs/conf.py index 867025d40..05352f36e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -76,6 +76,7 @@ intersphinx_mapping = { 'djcelery': ('http://django-celery.readthedocs.org/en/master', None), 'cyme': ('http://cyme.readthedocs.org/en/latest', None), 'amqp': ('http://amqp.readthedocs.org/en/latest', None), + 'vine': ('http://vine.readthedocs.org/en/latest', None), 'flower': ('http://flower.readthedocs.org/en/latest', None), } diff --git a/requirements/dev.txt b/requirements/dev.txt index 567243863..6d8fb7307 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,3 +1,4 @@ -https://github.com/celery/py-amqp/zipball/master https://github.com/celery/billiard/zipball/master https://github.com/celery/kombu/zipball/master +https://github.com/celery/py-amqp/zipball/master +https://github.com/celery/vine/zipball/master