فهرست منبع

Install isort from git. Fix import order.

Omer Katz 7 سال پیش
والد
کامیت
120770929f
100فایلهای تغییر یافته به همراه252 افزوده شده و 155 حذف شده
  1. 5 4
      celery/app/amqp.py
  2. 9 8
      celery/app/base.py
  3. 3 2
      celery/app/control.py
  4. 2 1
      celery/app/log.py
  5. 2 1
      celery/app/routes.py
  6. 3 2
      celery/app/task.py
  7. 6 5
      celery/app/trace.py
  8. 2 1
      celery/app/utils.py
  9. 3 2
      celery/apps/multi.py
  10. 2 1
      celery/apps/worker.py
  11. 2 1
      celery/backends/amqp.py
  12. 3 2
      celery/backends/async.py
  13. 5 4
      celery/backends/base.py
  14. 3 2
      celery/backends/cache.py
  15. 2 1
      celery/backends/consul.py
  16. 2 1
      celery/backends/couchbase.py
  17. 2 1
      celery/backends/couchdb.py
  18. 3 3
      celery/backends/database/models.py
  19. 0 1
      celery/backends/database/session.py
  20. 2 1
      celery/backends/dynamodb.py
  21. 3 2
      celery/backends/elasticsearch.py
  22. 2 1
      celery/backends/filesystem.py
  23. 4 3
      celery/backends/mongodb.py
  24. 4 3
      celery/backends/redis.py
  25. 2 1
      celery/backends/riak.py
  26. 4 3
      celery/backends/rpc.py
  27. 2 1
      celery/bin/amqp.py
  28. 2 1
      celery/bin/call.py
  29. 3 2
      celery/bin/control.py
  30. 2 1
      celery/bin/multi.py
  31. 7 5
      celery/canvas.py
  32. 5 4
      celery/concurrency/asynpool.py
  33. 2 1
      celery/concurrency/base.py
  34. 2 1
      celery/concurrency/eventlet.py
  35. 2 1
      celery/concurrency/prefork.py
  36. 4 3
      celery/contrib/migrate.py
  37. 1 0
      celery/contrib/rdb.py
  38. 0 1
      celery/contrib/sphinx.py
  39. 2 1
      celery/contrib/testing/app.py
  40. 2 1
      celery/contrib/testing/manager.py
  41. 2 1
      celery/events/dispatcher.py
  42. 4 3
      celery/events/receiver.py
  43. 2 1
      celery/events/snapshot.py
  44. 3 2
      celery/events/state.py
  45. 3 2
      celery/fixups/django.py
  46. 3 2
      celery/loaders/base.py
  47. 2 1
      celery/security/certificate.py
  48. 3 2
      celery/security/serialization.py
  49. 4 2
      celery/task/base.py
  50. 2 2
      celery/utils/collections.py
  51. 2 1
      celery/utils/deprecated.py
  52. 2 1
      celery/utils/dispatch/signal.py
  53. 2 1
      celery/utils/functional.py
  54. 2 1
      celery/utils/graph.py
  55. 2 1
      celery/utils/imports.py
  56. 3 2
      celery/utils/log.py
  57. 2 1
      celery/utils/serialization.py
  58. 3 2
      celery/utils/time.py
  59. 4 2
      celery/utils/timer2.py
  60. 2 1
      celery/worker/autoscale.py
  61. 5 4
      celery/worker/components.py
  62. 2 1
      celery/worker/consumer/connection.py
  63. 6 5
      celery/worker/consumer/consumer.py
  64. 2 1
      celery/worker/consumer/events.py
  65. 3 2
      celery/worker/consumer/gossip.py
  66. 2 1
      celery/worker/consumer/tasks.py
  67. 2 1
      celery/worker/control.py
  68. 3 2
      celery/worker/pidbox.py
  69. 3 2
      celery/worker/request.py
  70. 3 2
      celery/worker/state.py
  71. 3 2
      celery/worker/strategy.py
  72. 5 3
      celery/worker/worker.py
  73. 2 1
      t/benchmarks/bench_worker.py
  74. 1 0
      t/integration/conftest.py
  75. 2 2
      t/integration/test_canvas.py
  76. 2 1
      t/unit/app/test_amqp.py
  77. 4 2
      t/unit/app/test_app.py
  78. 1 0
      t/unit/app/test_backends.py
  79. 1 0
      t/unit/app/test_beat.py
  80. 1 0
      t/unit/app/test_builtins.py
  81. 2 1
      t/unit/app/test_celery.py
  82. 1 0
      t/unit/app/test_control.py
  83. 1 0
      t/unit/app/test_defaults.py
  84. 1 0
      t/unit/app/test_loaders.py
  85. 4 3
      t/unit/app/test_log.py
  86. 1 0
      t/unit/app/test_registry.py
  87. 3 2
      t/unit/app/test_routes.py
  88. 2 2
      t/unit/app/test_schedules.py
  89. 1 0
      t/unit/app/test_utils.py
  90. 1 0
      t/unit/apps/test_multi.py
  91. 1 0
      t/unit/backends/test_amqp.py
  92. 3 2
      t/unit/backends/test_base.py
  93. 2 1
      t/unit/backends/test_cache.py
  94. 1 0
      t/unit/backends/test_cassandra.py
  95. 1 0
      t/unit/backends/test_consul.py
  96. 2 1
      t/unit/backends/test_couchbase.py
  97. 1 0
      t/unit/backends/test_couchdb.py
  98. 1 0
      t/unit/backends/test_database.py
  99. 1 0
      t/unit/backends/test_dynamodb.py
  100. 1 0
      t/unit/backends/test_elasticsearch.py

+ 5 - 4
celery/app/amqp.py

@@ -8,6 +8,11 @@ from collections import Mapping, namedtuple
 from datetime import timedelta
 from weakref import WeakValueDictionary
 
+from kombu import Connection, Consumer, Exchange, Producer, Queue, pools
+from kombu.common import Broadcast
+from kombu.utils.functional import maybe_list
+from kombu.utils.objects import cached_property
+
 from celery import signals
 from celery.five import items, string_t
 from celery.local import try_import
@@ -15,10 +20,6 @@ from celery.utils.nodenames import anon_nodename
 from celery.utils.saferepr import saferepr
 from celery.utils.text import indent as textindent
 from celery.utils.time import maybe_make_aware
-from kombu import Connection, Consumer, Exchange, Producer, Queue, pools
-from kombu.common import Broadcast
-from kombu.utils.functional import maybe_list
-from kombu.utils.objects import cached_property
 
 from . import routes as _routes
 

+ 9 - 8
celery/app/base.py

@@ -9,6 +9,15 @@ from collections import defaultdict, deque
 from datetime import datetime
 from operator import attrgetter
 
+from kombu import pools
+from kombu.clocks import LamportClock
+from kombu.common import oid_from
+from kombu.utils.compat import register_after_fork
+from kombu.utils.objects import cached_property
+from kombu.utils.uuid import uuid
+from vine import starpromise
+from vine.utils import wraps
+
 from celery import platforms, signals
 from celery._state import (_announce_app_finalized, _deregister_app,
                            _register_app, _set_current_app, _task_stack,
@@ -28,14 +37,6 @@ from celery.utils.log import get_logger
 from celery.utils.objects import FallbackContext, mro_lookup
 from celery.utils.time import (get_exponential_backoff_interval, timezone,
                                to_utc)
-from kombu import pools
-from kombu.clocks import LamportClock
-from kombu.common import oid_from
-from kombu.utils.compat import register_after_fork
-from kombu.utils.objects import cached_property
-from kombu.utils.uuid import uuid
-from vine import starpromise
-from vine.utils import wraps
 
 # Load all builtin tasks
 from . import builtins  # noqa

+ 3 - 2
celery/app/control.py

@@ -9,12 +9,13 @@ from __future__ import absolute_import, unicode_literals
 import warnings
 
 from billiard.common import TERM_SIGNAME
-from celery.exceptions import DuplicateNodenameWarning
-from celery.utils.text import pluralize
 from kombu.pidbox import Mailbox
 from kombu.utils.functional import lazy
 from kombu.utils.objects import cached_property
 
+from celery.exceptions import DuplicateNodenameWarning
+from celery.utils.text import pluralize
+
 __all__ = ('Inspect', 'Control', 'flatten_reply')
 
 W_DUPNODE = """\

+ 2 - 1
celery/app/log.py

@@ -14,6 +14,8 @@ import os
 import sys
 from logging.handlers import WatchedFileHandler
 
+from kombu.utils.encoding import set_default_encoding_file
+
 from celery import signals
 from celery._state import get_current_task
 from celery.five import string_t
@@ -24,7 +26,6 @@ from celery.utils.log import (ColorFormatter, LoggingProxy, get_logger,
                               reset_multiprocessing_logger)
 from celery.utils.nodenames import node_format
 from celery.utils.term import colored
-from kombu.utils.encoding import set_default_encoding_file
 
 __all__ = ('TaskFormatter', 'Logging')
 

+ 2 - 1
celery/app/routes.py

@@ -9,12 +9,13 @@ import re
 import string
 from collections import Mapping, OrderedDict
 
+from kombu import Queue
+
 from celery.exceptions import QueueNotFound
 from celery.five import items, string_t
 from celery.utils.collections import lpmerge
 from celery.utils.functional import maybe_evaluate, mlazy
 from celery.utils.imports import symbol_by_name
-from kombu import Queue
 
 __all__ = ('MapRoute', 'Router', 'prepare')
 

+ 3 - 2
celery/app/task.py

@@ -5,6 +5,9 @@ from __future__ import absolute_import, unicode_literals
 import sys
 
 from billiard.einfo import ExceptionInfo
+from kombu.exceptions import OperationalError
+from kombu.utils.uuid import uuid
+
 from celery import current_app, group, states
 from celery._state import _task_stack
 from celery.canvas import signature
@@ -17,8 +20,6 @@ from celery.utils.functional import mattrgetter, maybe_list
 from celery.utils.imports import instantiate
 from celery.utils.nodenames import gethostname
 from celery.utils.serialization import raise_with_context
-from kombu.exceptions import OperationalError
-from kombu.utils.uuid import uuid
 
 from .annotations import resolve_all as resolve_all_annotations
 from .registry import _unpickle_task_v2

+ 6 - 5
celery/app/trace.py

@@ -13,10 +13,15 @@ from collections import namedtuple
 from warnings import warn
 
 from billiard.einfo import ExceptionInfo
+from kombu.exceptions import EncodeError
+from kombu.serialization import loads as loads_message
+from kombu.serialization import prepare_accept_content
+from kombu.utils.encoding import safe_repr, safe_str
+
 from celery import current_app, group, signals, states
 from celery._state import _task_stack
-from celery.app.task import Task as BaseTask
 from celery.app.task import Context
+from celery.app.task import Task as BaseTask
 from celery.exceptions import Ignore, InvalidTaskError, Reject, Retry
 from celery.five import monotonic, text_t
 from celery.utils.log import get_logger
@@ -26,10 +31,6 @@ from celery.utils.saferepr import saferepr
 from celery.utils.serialization import (get_pickleable_etype,
                                         get_pickleable_exception,
                                         get_pickled_exception)
-from kombu.exceptions import EncodeError
-from kombu.serialization import loads as loads_message
-from kombu.serialization import prepare_accept_content
-from kombu.utils.encoding import safe_repr, safe_str
 
 # ## ---
 # This is the heart of the worker, the inner loop so to speak.

+ 2 - 1
celery/app/utils.py

@@ -9,13 +9,14 @@ from collections import Mapping, namedtuple
 from copy import deepcopy
 from types import ModuleType
 
+from kombu.utils.url import maybe_sanitize_url
+
 from celery.exceptions import ImproperlyConfigured
 from celery.five import items, keys, string_t, values
 from celery.platforms import pyimplementation
 from celery.utils.collections import ConfigurationView
 from celery.utils.imports import import_from_cwd, qualname, symbol_by_name
 from celery.utils.text import pretty
-from kombu.utils.url import maybe_sanitize_url
 
 from .defaults import (_OLD_DEFAULTS, _OLD_SETTING_KEYS, _TO_NEW_KEY,
                        _TO_OLD_KEY, DEFAULTS, SETTING_KEYS, find)

+ 3 - 2
celery/apps/multi.py

@@ -11,13 +11,14 @@ from functools import partial
 from subprocess import Popen
 from time import sleep
 
+from kombu.utils.encoding import from_utf8
+from kombu.utils.objects import cached_property
+
 from celery.five import UserList, items
 from celery.platforms import IS_WINDOWS, Pidfile, signal_name
 from celery.utils.nodenames import (gethostname, host_format, node_format,
                                     nodesplit)
 from celery.utils.saferepr import saferepr
-from kombu.utils.encoding import from_utf8
-from kombu.utils.objects import cached_property
 
 __all__ = ('Cluster', 'Node')
 

+ 2 - 1
celery/apps/worker.py

@@ -17,6 +17,8 @@ from datetime import datetime
 from functools import partial
 
 from billiard.process import current_process
+from kombu.utils.encoding import safe_str
+
 from celery import VERSION_BANNER, platforms, signals
 from celery.app import trace
 from celery.exceptions import WorkerShutdown, WorkerTerminate
@@ -29,7 +31,6 @@ from celery.utils.imports import qualname
 from celery.utils.log import get_logger, in_sighandler, set_in_sighandler
 from celery.utils.text import pluralize
 from celery.worker import WorkController
-from kombu.utils.encoding import safe_str
 
 __all__ = ('Worker',)
 

+ 2 - 1
celery/backends/amqp.py

@@ -6,12 +6,13 @@ import socket
 from collections import deque
 from operator import itemgetter
 
+from kombu import Consumer, Exchange, Producer, Queue
+
 from celery import states
 from celery.exceptions import TimeoutError
 from celery.five import monotonic, range
 from celery.utils import deprecated
 from celery.utils.log import get_logger
-from kombu import Consumer, Exchange, Producer, Queue
 
 from .base import BaseBackend
 

+ 3 - 2
celery/backends/async.py

@@ -7,12 +7,13 @@ from collections import deque
 from time import sleep
 from weakref import WeakKeyDictionary
 
+from kombu.utils.compat import detect_environment
+from kombu.utils.objects import cached_property
+
 from celery import states
 from celery.exceptions import TimeoutError
 from celery.five import Empty, monotonic
 from celery.utils.threads import THREAD_TIMEOUT_MAX
-from kombu.utils.compat import detect_environment
-from kombu.utils.objects import cached_property
 
 __all__ = (
     'AsyncBackendMixin', 'BaseResultConsumer', 'Drainer',

+ 5 - 4
celery/backends/base.py

@@ -15,6 +15,11 @@ from datetime import timedelta
 from weakref import WeakValueDictionary
 
 from billiard.einfo import ExceptionInfo
+from kombu.serialization import dumps, loads, prepare_accept_content
+from kombu.serialization import registry as serializer_registry
+from kombu.utils.encoding import bytes_to_str, ensure_bytes, from_utf8
+from kombu.utils.url import maybe_sanitize_url
+
 from celery import current_app, group, maybe_signature, states
 from celery._state import get_current_task
 from celery.exceptions import (ChordError, ImproperlyConfigured,
@@ -28,10 +33,6 @@ from celery.utils.log import get_logger
 from celery.utils.serialization import (create_exception_cls,
                                         get_pickleable_exception,
                                         get_pickled_exception)
-from kombu.serialization import registry as serializer_registry
-from kombu.serialization import dumps, loads, prepare_accept_content
-from kombu.utils.encoding import bytes_to_str, ensure_bytes, from_utf8
-from kombu.utils.url import maybe_sanitize_url
 
 __all__ = ('BaseBackend', 'KeyValueStoreBackend', 'DisabledBackend')
 

+ 3 - 2
celery/backends/cache.py

@@ -4,11 +4,12 @@ from __future__ import absolute_import, unicode_literals
 
 import sys
 
-from celery.exceptions import ImproperlyConfigured
-from celery.utils.functional import LRUCache
 from kombu.utils.encoding import bytes_to_str, ensure_bytes
 from kombu.utils.objects import cached_property
 
+from celery.exceptions import ImproperlyConfigured
+from celery.utils.functional import LRUCache
+
 from .base import KeyValueStoreBackend
 
 __all__ = ('CacheBackend',)

+ 2 - 1
celery/backends/consul.py

@@ -6,10 +6,11 @@
 """
 from __future__ import absolute_import, unicode_literals
 
+from kombu.utils.url import parse_url
+
 from celery.backends.base import PY3, KeyValueStoreBackend
 from celery.exceptions import ImproperlyConfigured
 from celery.utils.log import get_logger
-from kombu.utils.url import parse_url
 
 try:
     import consul

+ 2 - 1
celery/backends/couchbase.py

@@ -4,10 +4,11 @@ from __future__ import absolute_import, unicode_literals
 
 import logging
 
-from celery.exceptions import ImproperlyConfigured
 from kombu.utils.encoding import str_t
 from kombu.utils.url import _parse_url
 
+from celery.exceptions import ImproperlyConfigured
+
 from .base import KeyValueStoreBackend
 
 try:

+ 2 - 1
celery/backends/couchdb.py

@@ -2,9 +2,10 @@
 """CouchDB result store backend."""
 from __future__ import absolute_import, unicode_literals
 
-from celery.exceptions import ImproperlyConfigured
 from kombu.utils.url import _parse_url
 
+from celery.exceptions import ImproperlyConfigured
+
 from .base import KeyValueStoreBackend
 
 try:

+ 3 - 3
celery/backends/database/models.py

@@ -4,12 +4,12 @@ from __future__ import absolute_import, unicode_literals
 
 from datetime import datetime
 
-from celery import states
-from celery.five import python_2_unicode_compatible
-
 import sqlalchemy as sa
 from sqlalchemy.types import PickleType
 
+from celery import states
+from celery.five import python_2_unicode_compatible
+
 from .session import ResultModelBase
 
 __all__ = ('Task', 'TaskSet')

+ 0 - 1
celery/backends/database/session.py

@@ -3,7 +3,6 @@
 from __future__ import absolute_import, unicode_literals
 
 from kombu.utils.compat import register_after_fork
-
 from sqlalchemy import create_engine
 from sqlalchemy.ext.declarative import declarative_base
 from sqlalchemy.orm import sessionmaker

+ 2 - 1
celery/backends/dynamodb.py

@@ -5,10 +5,11 @@ from __future__ import absolute_import, unicode_literals
 from collections import namedtuple
 from time import sleep, time
 
+from kombu.utils.url import _parse_url as parse_url
+
 from celery.exceptions import ImproperlyConfigured
 from celery.five import string
 from celery.utils.log import get_logger
-from kombu.utils.url import _parse_url as parse_url
 
 from .base import KeyValueStoreBackend
 

+ 3 - 2
celery/backends/elasticsearch.py

@@ -4,11 +4,12 @@ from __future__ import absolute_import, unicode_literals
 
 from datetime import datetime
 
-from celery.exceptions import ImproperlyConfigured
-from celery.five import items
 from kombu.utils.encoding import bytes_to_str
 from kombu.utils.url import _parse_url
 
+from celery.exceptions import ImproperlyConfigured
+from celery.five import items
+
 from .base import KeyValueStoreBackend
 
 try:

+ 2 - 1
celery/backends/filesystem.py

@@ -5,10 +5,11 @@ from __future__ import absolute_import, unicode_literals
 import locale
 import os
 
+from kombu.utils.encoding import ensure_bytes
+
 from celery import uuid
 from celery.backends.base import KeyValueStoreBackend
 from celery.exceptions import ImproperlyConfigured
-from kombu.utils.encoding import ensure_bytes
 
 # Python 2 does not have FileNotFoundError and IsADirectoryError
 try:

+ 4 - 3
celery/backends/mongodb.py

@@ -4,13 +4,14 @@ from __future__ import absolute_import, unicode_literals
 
 from datetime import datetime, timedelta
 
-from celery import states
-from celery.exceptions import ImproperlyConfigured
-from celery.five import items, string_t
 from kombu.exceptions import EncodeError
 from kombu.utils.objects import cached_property
 from kombu.utils.url import maybe_sanitize_url
 
+from celery import states
+from celery.exceptions import ImproperlyConfigured
+from celery.five import items, string_t
+
 from .base import BaseBackend
 
 try:

+ 4 - 3
celery/backends/redis.py

@@ -4,6 +4,10 @@ from __future__ import absolute_import, unicode_literals
 
 from functools import partial
 
+from kombu.utils.functional import retry_over_time
+from kombu.utils.objects import cached_property
+from kombu.utils.url import _parse_url
+
 from celery import states
 from celery._state import task_join_will_block
 from celery.canvas import maybe_signature
@@ -13,9 +17,6 @@ from celery.utils import deprecated
 from celery.utils.functional import dictfilter
 from celery.utils.log import get_logger
 from celery.utils.time import humanize_seconds
-from kombu.utils.functional import retry_over_time
-from kombu.utils.objects import cached_property
-from kombu.utils.url import _parse_url
 
 from . import async, base
 

+ 2 - 1
celery/backends/riak.py

@@ -4,9 +4,10 @@ from __future__ import absolute_import, unicode_literals
 
 import sys
 
-from celery.exceptions import ImproperlyConfigured
 from kombu.utils.url import _parse_url
 
+from celery.exceptions import ImproperlyConfigured
+
 from .base import KeyValueStoreBackend
 
 try:

+ 4 - 3
celery/backends/rpc.py

@@ -8,13 +8,14 @@ from __future__ import absolute_import, unicode_literals
 import time
 
 import kombu
-from celery import states
-from celery._state import current_task, task_join_will_block
-from celery.five import items, range
 from kombu.common import maybe_declare
 from kombu.utils.compat import register_after_fork
 from kombu.utils.objects import cached_property
 
+from celery import states
+from celery._state import current_task, task_join_will_block
+from celery.five import items, range
+
 from . import base
 from .async import AsyncBackendMixin, BaseResultConsumer
 

+ 2 - 1
celery/bin/amqp.py

@@ -12,11 +12,12 @@ import sys
 from functools import partial
 from itertools import count
 
+from kombu.utils.encoding import safe_str
+
 from celery.bin.base import Command
 from celery.five import string_t
 from celery.utils.functional import padlist
 from celery.utils.serialization import strtobool
-from kombu.utils.encoding import safe_str
 
 __all__ = ('AMQPAdmin', 'AMQShell', 'Spec', 'amqp')
 

+ 2 - 1
celery/bin/call.py

@@ -1,10 +1,11 @@
 """The ``celery call`` program used to send tasks from the command-line."""
 from __future__ import absolute_import, unicode_literals
 
+from kombu.utils.json import loads
+
 from celery.bin.base import Command
 from celery.five import string_t
 from celery.utils.time import maybe_iso8601
-from kombu.utils.json import loads
 
 
 class call(Command):

+ 3 - 2
celery/bin/control.py

@@ -1,12 +1,13 @@
 """The ``celery control``, ``. inspect`` and ``. status`` programs."""
 from __future__ import absolute_import, unicode_literals
 
+from kombu.utils.json import dumps
+from kombu.utils.objects import cached_property
+
 from celery.bin.base import Command
 from celery.five import items, string_t
 from celery.platforms import EX_UNAVAILABLE, EX_USAGE
 from celery.utils import text
-from kombu.utils.json import dumps
-from kombu.utils.objects import cached_property
 
 
 class _RemoteControl(Command):

+ 2 - 1
celery/bin/multi.py

@@ -100,12 +100,13 @@ import signal
 import sys
 from functools import wraps
 
+from kombu.utils.objects import cached_property
+
 from celery import VERSION_BANNER
 from celery.apps.multi import Cluster, MultiParser, NamespacedOptionParser
 from celery.platforms import EX_FAILURE, EX_OK, signals
 from celery.utils import term
 from celery.utils.text import pluralize
-from kombu.utils.objects import cached_property
 
 __all__ = ('MultiTool',)
 

+ 7 - 5
celery/canvas.py

@@ -16,20 +16,22 @@ from functools import partial as _partial
 from functools import reduce
 from operator import itemgetter
 
+from kombu.utils.functional import fxrange, reprcall
+from kombu.utils.objects import cached_property
+from kombu.utils.uuid import uuid
+from vine import barrier
+
 from celery._state import current_app
 from celery.five import python_2_unicode_compatible
 from celery.local import try_import
 from celery.result import GroupResult
 from celery.utils import abstract
+from celery.utils.functional import _regen
 from celery.utils.functional import chunks as _chunks
-from celery.utils.functional import (_regen, is_list, maybe_list, regen,
+from celery.utils.functional import (is_list, maybe_list, regen,
                                      seq_concat_item, seq_concat_seq)
 from celery.utils.objects import getitem_property
 from celery.utils.text import remove_repeating_from_task, truncate
-from kombu.utils.functional import fxrange, reprcall
-from kombu.utils.objects import cached_property
-from kombu.utils.uuid import uuid
-from vine import barrier
 
 __all__ = (
     'Signature', 'chain', 'xmap', 'xstarmap', 'chunks',

+ 5 - 4
celery/concurrency/asynpool.py

@@ -34,16 +34,17 @@ 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 celery.five import Counter, items, values
-from celery.utils.functional import noop
-from celery.utils.log import get_logger
-from celery.worker import state as worker_state
 from kombu.async import ERR, WRITE
 from kombu.serialization import pickle as _pickle
 from kombu.utils.eventio import SELECT_BAD_FD
 from kombu.utils.functional import fxrange
 from vine import promise
 
+from celery.five import Counter, items, values
+from celery.utils.functional import noop
+from celery.utils.log import get_logger
+from celery.worker import state as worker_state
+
 # pylint: disable=redefined-outer-name
 # We cache globals and attribute lookups, so disable this warning.
 

+ 2 - 1
celery/concurrency/base.py

@@ -8,12 +8,13 @@ import sys
 
 from billiard.einfo import ExceptionInfo
 from billiard.exceptions import WorkerLostError
+from kombu.utils.encoding import safe_repr
+
 from celery.exceptions import WorkerShutdown, WorkerTerminate
 from celery.five import monotonic, reraise
 from celery.utils import timer2
 from celery.utils.log import get_logger
 from celery.utils.text import truncate
-from kombu.utils.encoding import safe_repr
 
 __all__ = ('BasePool', 'apply_target')
 

+ 2 - 1
celery/concurrency/eventlet.py

@@ -4,10 +4,11 @@ from __future__ import absolute_import, unicode_literals
 
 import sys
 
-from celery import signals  # noqa
 from kombu.async import timer as _timer  # noqa
 from kombu.five import monotonic
 
+from celery import signals  # noqa
+
 from . import base  # noqa
 
 __all__ = ('TaskPool',)

+ 2 - 1
celery/concurrency/prefork.py

@@ -9,8 +9,9 @@ import os
 
 from billiard import forking_enable
 from billiard.common import REMAP_SIGTERM, TERM_SIGNAME
-from billiard.pool import Pool as BlockingPool
 from billiard.pool import CLOSE, RUN
+from billiard.pool import Pool as BlockingPool
+
 from celery import platforms, signals
 from celery._state import _set_task_join_will_block, set_default_app
 from celery.app import trace

+ 4 - 3
celery/contrib/migrate.py

@@ -6,13 +6,14 @@ import socket
 from functools import partial
 from itertools import cycle, islice
 
+from kombu import Queue, eventloop
+from kombu.common import maybe_declare
+from kombu.utils.encoding import ensure_bytes
+
 from celery.app import app_or_default
 from celery.five import python_2_unicode_compatible, string, string_t
 from celery.utils.nodenames import worker_direct
 from celery.utils.text import str_to_list
-from kombu import Queue, eventloop
-from kombu.common import maybe_declare
-from kombu.utils.encoding import ensure_bytes
 
 __all__ = (
     'StopFiltering', 'State', 'republish', 'migrate_task',

+ 1 - 0
celery/contrib/rdb.py

@@ -50,6 +50,7 @@ import sys
 from pdb import Pdb
 
 from billiard.process import current_process
+
 from celery.five import range
 
 __all__ = (

+ 0 - 1
celery/contrib/sphinx.py

@@ -31,7 +31,6 @@ Use ``.. autotask::`` to manually document a task.
 from __future__ import absolute_import, unicode_literals
 
 from celery.app.task import BaseTask
-
 from sphinx.domains.python import PyModulelevel
 from sphinx.ext.autodoc import FunctionDocumenter
 

+ 2 - 1
celery/contrib/testing/app.py

@@ -5,9 +5,10 @@ import weakref
 from contextlib import contextmanager
 from copy import deepcopy
 
-from celery import Celery, _state
 from kombu.utils.imports import symbol_by_name
 
+from celery import Celery, _state
+
 #: Contains the default configuration values for the test app.
 DEFAULT_TEST_CONFIG = {
     'worker_hijack_root_logger': False,

+ 2 - 1
celery/contrib/testing/manager.py

@@ -7,12 +7,13 @@ from collections import defaultdict
 from functools import partial
 from itertools import count
 
+from kombu.utils.functional import retry_over_time
+
 from celery.exceptions import TimeoutError
 from celery.five import items
 from celery.result import ResultSet
 from celery.utils.text import truncate
 from celery.utils.time import humanize_seconds as _humanize_seconds
-from kombu.utils.functional import retry_over_time
 
 E_STILL_WAITING = 'Still waiting for {0}.  Trying again {when}: {exc!r}'
 

+ 2 - 1
celery/events/dispatcher.py

@@ -6,11 +6,12 @@ import threading
 import time
 from collections import defaultdict, deque
 
+from kombu import Producer
+
 from celery.app import app_or_default
 from celery.five import items
 from celery.utils.nodenames import anon_nodename
 from celery.utils.time import utcoffset
-from kombu import Producer
 
 from .event import Event, get_exchange, group_from
 

+ 4 - 3
celery/events/receiver.py

@@ -4,13 +4,14 @@ from __future__ import absolute_import, unicode_literals
 import time
 from operator import itemgetter
 
-from celery import uuid
-from celery.app import app_or_default
-from celery.utils.time import adjust_timestamp
 from kombu import Queue
 from kombu.connection import maybe_channel
 from kombu.mixins import ConsumerMixin
 
+from celery import uuid
+from celery.app import app_or_default
+from celery.utils.time import adjust_timestamp
+
 from .event import get_exchange
 
 __all__ = ('EventReceiver',)

+ 2 - 1
celery/events/snapshot.py

@@ -9,6 +9,8 @@ in :mod:`djcelery.snapshots` in the `django-celery` distribution.
 """
 from __future__ import absolute_import, print_function, unicode_literals
 
+from kombu.utils.limits import TokenBucket
+
 from celery import platforms
 from celery.app import app_or_default
 from celery.utils.dispatch import Signal
@@ -16,7 +18,6 @@ from celery.utils.imports import instantiate
 from celery.utils.log import get_logger
 from celery.utils.time import rate
 from celery.utils.timer2 import Timer
-from kombu.utils.limits import TokenBucket
 
 __all__ = ('Polaroid', 'evcam')
 

+ 3 - 2
celery/events/state.py

@@ -26,12 +26,13 @@ from operator import itemgetter
 from time import time
 from weakref import WeakSet, ref
 
+from kombu.clocks import timetuple
+from kombu.utils.objects import cached_property
+
 from celery import states
 from celery.five import items, python_2_unicode_compatible, values
 from celery.utils.functional import LRUCache, memoize, pass1
 from celery.utils.log import get_logger
-from kombu.clocks import timetuple
-from kombu.utils.objects import cached_property
 
 __all__ = ('Worker', 'Task', 'State', 'heartbeat_expires')
 

+ 3 - 2
celery/fixups/django.py

@@ -7,11 +7,12 @@ import warnings
 from datetime import datetime
 from importlib import import_module
 
-from celery import _state, signals
-from celery.exceptions import FixupWarning, ImproperlyConfigured
 from kombu.utils.imports import symbol_by_name
 from kombu.utils.objects import cached_property
 
+from celery import _state, signals
+from celery.exceptions import FixupWarning, ImproperlyConfigured
+
 __all__ = ('DjangoFixup', 'fixup')
 
 ERR_NOT_INSTALLED = """\

+ 3 - 2
celery/loaders/base.py

@@ -8,14 +8,15 @@ import re
 import sys
 from datetime import datetime
 
+from kombu.utils import json
+from kombu.utils.objects import cached_property
+
 from celery import signals
 from celery.five import reraise, string_t
 from celery.utils.collections import DictAttribute, force_mapping
 from celery.utils.functional import maybe_list
 from celery.utils.imports import (NotAPackage, find_module, import_from_cwd,
                                   symbol_by_name)
-from kombu.utils import json
-from kombu.utils.objects import cached_property
 
 __all__ = ('BaseLoader',)
 

+ 2 - 1
celery/security/certificate.py

@@ -5,9 +5,10 @@ from __future__ import absolute_import, unicode_literals
 import glob
 import os
 
+from kombu.utils.encoding import bytes_to_str
+
 from celery.exceptions import SecurityError
 from celery.five import values
-from kombu.utils.encoding import bytes_to_str
 
 from .utils import crypto, reraise_errors
 

+ 3 - 2
celery/security/serialization.py

@@ -2,11 +2,12 @@
 """Secure serializer."""
 from __future__ import absolute_import, unicode_literals
 
-from celery.five import bytes_if_py2
-from celery.utils.serialization import b64decode, b64encode
 from kombu.serialization import dumps, loads, registry
 from kombu.utils.encoding import bytes_to_str, ensure_bytes, str_to_bytes
 
+from celery.five import bytes_if_py2
+from celery.utils.serialization import b64decode, b64encode
+
 from .certificate import Certificate, FSCertStore
 from .key import PrivateKey
 from .utils import reraise_errors

+ 4 - 2
celery/task/base.py

@@ -8,14 +8,16 @@ and shouldn't be used in new applications.
 """
 from __future__ import absolute_import, unicode_literals
 
+from kombu import Exchange
+
 from celery import current_app
+from celery.app.task import Context
 from celery.app.task import Task as BaseTask
-from celery.app.task import Context, _reprtask
+from celery.app.task import _reprtask
 from celery.five import python_2_unicode_compatible, with_metaclass
 from celery.local import Proxy, class_property, reclassmethod
 from celery.schedules import maybe_schedule
 from celery.utils.log import get_task_logger
-from kombu import Exchange
 
 __all__ = ('Context', 'Task', 'TaskType', 'PeriodicTask', 'task')
 

+ 2 - 2
celery/utils/collections.py

@@ -3,9 +3,9 @@
 from __future__ import absolute_import, unicode_literals
 
 import sys
+from collections import Callable, Mapping, MutableMapping, MutableSet
 from collections import OrderedDict as _OrderedDict
-from collections import (Callable, Mapping, MutableMapping, MutableSet,
-                         Sequence, deque)
+from collections import Sequence, deque
 from heapq import heapify, heappop, heappush
 from itertools import chain, count
 

+ 2 - 1
celery/utils/deprecated.py

@@ -4,9 +4,10 @@ from __future__ import absolute_import, print_function, unicode_literals
 
 import warnings
 
-from celery.exceptions import CDeprecationWarning, CPendingDeprecationWarning
 from vine.utils import wraps
 
+from celery.exceptions import CDeprecationWarning, CPendingDeprecationWarning
+
 __all__ = ('Callable', 'Property', 'warn')
 
 

+ 2 - 1
celery/utils/dispatch/signal.py

@@ -7,13 +7,14 @@ import threading
 import warnings
 import weakref
 
+from kombu.utils.functional import retry_over_time
+
 from celery.exceptions import CDeprecationWarning
 from celery.five import python_2_unicode_compatible, range, text_t
 from celery.local import PromiseProxy, Proxy
 from celery.utils.functional import fun_accepts_kwargs
 from celery.utils.log import get_logger
 from celery.utils.time import humanize_seconds
-from kombu.utils.functional import retry_over_time
 
 try:
     from weakref import WeakMethod

+ 2 - 1
celery/utils/functional.py

@@ -7,11 +7,12 @@ import sys
 from functools import partial
 from itertools import chain, islice
 
-from celery.five import UserList, getfullargspec, range
 from kombu.utils.functional import (LRUCache, dictfilter, is_list, lazy,
                                     maybe_evaluate, maybe_list, memoize)
 from vine import promise
 
+from celery.five import UserList, getfullargspec, range
+
 __all__ = (
     'LRUCache', 'is_list', 'maybe_list', 'memoize', 'mlazy', 'noop',
     'first', 'firstmethod', 'chunks', 'padlist', 'mattrgetter', 'uniq',

+ 2 - 1
celery/utils/graph.py

@@ -5,9 +5,10 @@ from __future__ import absolute_import, print_function, unicode_literals
 from collections import Counter
 from textwrap import dedent
 
-from celery.five import items, python_2_unicode_compatible
 from kombu.utils.encoding import bytes_to_str, safe_str
 
+from celery.five import items, python_2_unicode_compatible
+
 __all__ = ('DOT', 'CycleError', 'DependencyGraph', 'GraphFormatter')
 
 

+ 2 - 1
celery/utils/imports.py

@@ -9,9 +9,10 @@ import sys
 import warnings
 from contextlib import contextmanager
 
-from celery.five import reload
 from kombu.utils.imports import symbol_by_name
 
+from celery.five import reload
+
 #: Billiard sets this when execv is enabled.
 #: We use it to find out the name of the original ``__main__``
 #: module, so that we can properly rewrite the name of the

+ 3 - 2
celery/utils/log.py

@@ -10,12 +10,13 @@ import threading
 import traceback
 from contextlib import contextmanager
 
-from celery.five import string_t, text_t
 from kombu.five import values
-from kombu.log import get_logger as _get_logger
 from kombu.log import LOG_LEVELS
+from kombu.log import get_logger as _get_logger
 from kombu.utils.encoding import safe_str
 
+from celery.five import string_t, text_t
+
 from .term import colored
 
 __all__ = (

+ 2 - 1
celery/utils/serialization.py

@@ -11,9 +11,10 @@ from functools import partial
 from inspect import getmro
 from itertools import takewhile
 
+from kombu.utils.encoding import bytes_to_str, str_to_bytes
+
 from celery.five import (bytes_if_py2, items, python_2_unicode_compatible,
                          reraise, string_t)
-from kombu.utils.encoding import bytes_to_str, str_to_bytes
 
 from .encoding import safe_repr
 

+ 3 - 2
celery/utils/time.py

@@ -10,11 +10,12 @@ import time as _time
 from calendar import monthrange
 from datetime import date, datetime, timedelta, tzinfo
 
-from celery.five import python_2_unicode_compatible, string_t
 from kombu.utils.functional import reprcall
 from kombu.utils.objects import cached_property
-from pytz import timezone as _timezone
 from pytz import AmbiguousTimeError, FixedOffset
+from pytz import timezone as _timezone
+
+from celery.five import python_2_unicode_compatible, string_t
 
 from .functional import dictfilter
 from .iso8601 import parse_iso8601

+ 4 - 2
celery/utils/timer2.py

@@ -13,9 +13,11 @@ import threading
 from itertools import count
 from time import sleep
 
-from celery.five import THREAD_TIMEOUT_MAX
+from kombu.async.timer import Entry
 from kombu.async.timer import Timer as Schedule
-from kombu.async.timer import Entry, logger, to_timestamp
+from kombu.async.timer import logger, to_timestamp
+
+from celery.five import THREAD_TIMEOUT_MAX
 
 TIMER_DEBUG = os.environ.get('TIMER_DEBUG')
 

+ 2 - 1
celery/worker/autoscale.py

@@ -14,11 +14,12 @@ import os
 import threading
 from time import sleep
 
+from kombu.async.semaphore import DummyLock
+
 from celery import bootsteps
 from celery.five import monotonic
 from celery.utils.log import get_logger
 from celery.utils.threads import bgThread
-from kombu.async.semaphore import DummyLock
 
 from . import state
 from .components import Pool

+ 5 - 4
celery/worker/components.py

@@ -5,16 +5,17 @@ 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 celery import bootsteps
 from celery._state import _set_task_join_will_block
 from celery.exceptions import ImproperlyConfigured
 from celery.five import string_t
 from celery.platforms import IS_WINDOWS
 from celery.utils.log import worker_logger as logger
-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
 
 __all__ = ('Timer', 'Hub', 'Pool', 'Beat', 'StateDB', 'Consumer')
 

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

@@ -1,9 +1,10 @@
 """Consumer Broker Connection Bootstep."""
 from __future__ import absolute_import, unicode_literals
 
+from kombu.common import ignore_errors
+
 from celery import bootsteps
 from celery.utils.log import get_logger
-from kombu.common import ignore_errors
 
 __all__ = ('Connection',)
 

+ 6 - 5
celery/worker/consumer/consumer.py

@@ -15,6 +15,12 @@ from time import sleep
 
 from billiard.common import restart_state
 from billiard.exceptions import RestartFreqExceeded
+from kombu.async.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
+from vine import ppartial, promise
+
 from celery import bootsteps, signals
 from celery.app.trace import build_tracer
 from celery.exceptions import InvalidTaskError, NotRegistered
@@ -28,11 +34,6 @@ from celery.utils.time import humanize_seconds, rate
 from celery.worker import loops
 from celery.worker.state import (maybe_shutdown, reserved_requests,
                                  task_reserved)
-from kombu.async.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
-from vine import ppartial, promise
 
 __all__ = ('Consumer', 'Evloop', 'dump_body')
 

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

@@ -4,9 +4,10 @@
 """
 from __future__ import absolute_import, unicode_literals
 
-from celery import bootsteps
 from kombu.common import ignore_errors
 
+from celery import bootsteps
+
 from .connection import Connection
 
 __all__ = ('Events',)

+ 3 - 2
celery/worker/consumer/gossip.py

@@ -6,12 +6,13 @@ from functools import partial
 from heapq import heappush
 from operator import itemgetter
 
+from kombu import Consumer
+from kombu.async.semaphore import DummyLock
+
 from celery import bootsteps
 from celery.five import values
 from celery.utils.log import get_logger
 from celery.utils.objects import Bunch
-from kombu import Consumer
-from kombu.async.semaphore import DummyLock
 
 from .mingle import Mingle
 

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

@@ -1,9 +1,10 @@
 """Worker Task Consumer Bootstep."""
 from __future__ import absolute_import, unicode_literals
 
+from kombu.common import QoS, ignore_errors
+
 from celery import bootsteps
 from celery.utils.log import get_logger
-from kombu.common import QoS, ignore_errors
 
 from .mingle import Mingle
 

+ 2 - 1
celery/worker/control.py

@@ -7,6 +7,8 @@ import tempfile
 from collections import namedtuple
 
 from billiard.common import TERM_SIGNAME
+from kombu.utils.encoding import safe_repr
+
 from celery.exceptions import WorkerShutdown
 from celery.five import UserDict, items, string_t, text_t
 from celery.platforms import signals as _signals
@@ -14,7 +16,6 @@ from celery.utils.functional import maybe_list
 from celery.utils.log import get_logger
 from celery.utils.serialization import jsonify, strtobool
 from celery.utils.time import rate
-from kombu.utils.encoding import safe_repr
 
 from . import state as worker_state
 from .request import Request

+ 3 - 2
celery/worker/pidbox.py

@@ -4,11 +4,12 @@ from __future__ import absolute_import, unicode_literals
 import socket
 import threading
 
+from kombu.common import ignore_errors
+from kombu.utils.encoding import safe_str
+
 from celery.utils.collections import AttributeDict
 from celery.utils.functional import pass1
 from celery.utils.log import get_logger
-from kombu.common import ignore_errors
-from kombu.utils.encoding import safe_str
 
 from . import control
 

+ 3 - 2
celery/worker/request.py

@@ -12,6 +12,9 @@ from datetime import datetime
 from weakref import ref
 
 from billiard.common import TERM_SIGNAME
+from kombu.utils.encoding import safe_repr, safe_str
+from kombu.utils.objects import cached_property
+
 from celery import signals
 from celery.app.trace import trace_task, trace_task_ret
 from celery.exceptions import (Ignore, InvalidTaskError, Reject, Retry,
@@ -24,8 +27,6 @@ from celery.utils.log import get_logger
 from celery.utils.nodenames import gethostname
 from celery.utils.serialization import get_pickled_exception
 from celery.utils.time import maybe_iso8601, maybe_make_aware, timezone
-from kombu.utils.encoding import safe_repr, safe_str
-from kombu.utils.objects import cached_property
 
 from . import state
 

+ 3 - 2
celery/worker/state.py

@@ -13,12 +13,13 @@ import sys
 import weakref
 import zlib
 
+from kombu.serialization import pickle, pickle_protocol
+from kombu.utils.objects import cached_property
+
 from celery import __version__
 from celery.exceptions import WorkerShutdown, WorkerTerminate
 from celery.five import Counter
 from celery.utils.collections import LimitedSet
-from kombu.serialization import pickle, pickle_protocol
-from kombu.utils.objects import cached_property
 
 __all__ = (
     'SOFTWARE_INFO', 'reserved_requests', 'active_requests',

+ 3 - 2
celery/worker/strategy.py

@@ -4,13 +4,14 @@ from __future__ import absolute_import, unicode_literals
 
 import logging
 
+from kombu.async.timer import to_timestamp
+from kombu.five import buffer_t
+
 from celery.exceptions import InvalidTaskError
 from celery.utils.imports import symbol_by_name
 from celery.utils.log import get_logger
 from celery.utils.saferepr import saferepr
 from celery.utils.time import timezone
-from kombu.async.timer import to_timestamp
-from kombu.five import buffer_t
 
 from .request import create_request_cls
 from .state import task_reserved

+ 5 - 3
celery/worker/worker.py

@@ -18,20 +18,22 @@ import os
 import sys
 
 from billiard import cpu_count
+from kombu.utils.compat import detect_environment
+
+from celery import bootsteps
 from celery import concurrency as _concurrency
-from celery import bootsteps, signals
+from celery import signals
 from celery.bootsteps import RUN, TERMINATE
 from celery.exceptions import (ImproperlyConfigured, TaskRevokedError,
                                WorkerTerminate)
 from celery.five import python_2_unicode_compatible, values
 from celery.platforms import EX_FAILURE, create_pidlock
 from celery.utils.imports import reload_from_cwd
-from celery.utils.log import worker_logger as logger
 from celery.utils.log import mlevel
+from celery.utils.log import worker_logger as logger
 from celery.utils.nodenames import default_nodename, worker_direct
 from celery.utils.text import str_to_list
 from celery.utils.threads import default_socket_timeout
-from kombu.utils.compat import detect_environment
 
 from . import state
 

+ 2 - 1
t/benchmarks/bench_worker.py

@@ -3,9 +3,10 @@ from __future__ import absolute_import, print_function, unicode_literals
 import os
 import sys
 
+from kombu.five import monotonic  # noqa
+
 from celery import Celery  # noqa
 from celery.five import range  # noqa
-from kombu.five import monotonic  # noqa
 
 os.environ.update(
     NOSETPS='yes',

+ 1 - 0
t/integration/conftest.py

@@ -4,6 +4,7 @@ import os
 from functools import wraps
 
 import pytest
+
 from celery.contrib.testing.manager import Manager
 
 TEST_BROKER = os.environ.get('TEST_BROKER', 'pyamqp://')

+ 2 - 2
t/integration/test_canvas.py

@@ -1,12 +1,12 @@
 from __future__ import absolute_import, unicode_literals
 
 import pytest
+from redis import StrictRedis
+
 from celery import chain, chord, group
 from celery.exceptions import TimeoutError
 from celery.result import AsyncResult, GroupResult
 
-from redis import StrictRedis
-
 from .conftest import flaky
 from .tasks import add, add_replaced, add_to_all, collect_ids, ids, redis_echo
 

+ 2 - 1
t/unit/app/test_amqp.py

@@ -4,11 +4,12 @@ from datetime import datetime, timedelta
 
 import pytest
 from case import Mock
+from kombu import Exchange, Queue
+
 from celery import uuid
 from celery.app.amqp import Queues, utf8dict
 from celery.five import keys
 from celery.utils.time import to_utc
-from kombu import Exchange, Queue
 
 
 class test_TaskConsumer:

+ 4 - 2
t/unit/app/test_app.py

@@ -9,8 +9,11 @@ from pickle import dumps, loads
 
 import pytest
 from case import ContextMock, Mock, mock, patch
+from vine import promise
+
+from celery import Celery, _state
 from celery import app as _app
-from celery import Celery, _state, current_app, shared_task
+from celery import current_app, shared_task
 from celery.app import base as _appbase
 from celery.app import defaults
 from celery.exceptions import ImproperlyConfigured
@@ -21,7 +24,6 @@ from celery.utils.collections import DictAttribute
 from celery.utils.objects import Bunch
 from celery.utils.serialization import pickle
 from celery.utils.time import localize, timezone, to_utc
-from vine import promise
 
 THIS_IS_A_KEY = 'this is a value'
 

+ 1 - 0
t/unit/app/test_backends.py

@@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals
 
 import pytest
 from case import patch
+
 from celery.app import backends
 from celery.backends.amqp import AMQPBackend
 from celery.backends.cache import CacheBackend

+ 1 - 0
t/unit/app/test_beat.py

@@ -6,6 +6,7 @@ from pickle import dumps, loads
 
 import pytest
 from case import Mock, call, patch, skip
+
 from celery import beat, uuid
 from celery.beat import event_t
 from celery.five import keys, string_t

+ 1 - 0
t/unit/app/test_builtins.py

@@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals
 
 import pytest
 from case import ContextMock, Mock, patch
+
 from celery import chord, group
 from celery.app import builtins
 from celery.five import range

+ 2 - 1
t/unit/app/test_celery.py

@@ -1,8 +1,9 @@
 from __future__ import absolute_import, unicode_literals
 
-import celery
 import pytest
 
+import celery
+
 
 def test_version():
     assert celery.VERSION

+ 1 - 0
t/unit/app/test_control.py

@@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals
 
 import pytest
 from case import Mock
+
 from celery import uuid
 from celery.app import control
 from celery.exceptions import DuplicateNodenameWarning

+ 1 - 0
t/unit/app/test_defaults.py

@@ -4,6 +4,7 @@ import sys
 from importlib import import_module
 
 from case import mock
+
 from celery.app.defaults import (_OLD_DEFAULTS, _OLD_SETTING_KEYS,
                                  _TO_NEW_KEY, _TO_OLD_KEY, DEFAULTS,
                                  NAMESPACES, SETTING_KEYS)

+ 1 - 0
t/unit/app/test_loaders.py

@@ -6,6 +6,7 @@ import warnings
 
 import pytest
 from case import Mock, mock, patch
+
 from celery import loaders
 from celery.exceptions import NotConfigured
 from celery.five import bytes_if_py2

+ 4 - 3
t/unit/app/test_log.py

@@ -9,13 +9,14 @@ from tempfile import mktemp
 import pytest
 from case import Mock, mock, patch, skip
 from case.utils import get_logger_handlers
+
 from celery import signals, uuid
 from celery.app.log import TaskFormatter
 from celery.five import python_2_unicode_compatible
-from celery.utils.log import logger as base_logger
 from celery.utils.log import (ColorFormatter, LoggingProxy, get_logger,
-                              get_task_logger, in_sighandler, logger_isa,
-                              task_logger)
+                              get_task_logger, in_sighandler)
+from celery.utils.log import logger as base_logger
+from celery.utils.log import logger_isa, task_logger
 
 
 class test_TaskFormatter:

+ 1 - 0
t/unit/app/test_registry.py

@@ -1,6 +1,7 @@
 from __future__ import absolute_import, unicode_literals
 
 import pytest
+
 from celery.app.registry import _unpickle_task, _unpickle_task_v2
 from celery.exceptions import InvalidTaskError
 

+ 3 - 2
t/unit/app/test_routes.py

@@ -2,12 +2,13 @@ from __future__ import absolute_import, unicode_literals
 
 import pytest
 from case import ANY, Mock
+from kombu import Exchange, Queue
+from kombu.utils.functional import maybe_evaluate
+
 from celery.app import routes
 from celery.exceptions import QueueNotFound
 from celery.five import items
 from celery.utils.imports import qualname
-from kombu import Exchange, Queue
-from kombu.utils.functional import maybe_evaluate
 
 
 def Router(app, *args, **kwargs):

+ 2 - 2
t/unit/app/test_schedules.py

@@ -7,12 +7,12 @@ from pickle import dumps, loads
 
 import pytest
 import pytz
+from case import Case, Mock, skip
+
 from celery.five import items
 from celery.schedules import (ParseException, crontab, crontab_parser,
                               schedule, solar)
 
-from case import Case, Mock, skip
-
 assertions = Case('__init__')
 
 

+ 1 - 0
t/unit/app/test_utils.py

@@ -3,6 +3,7 @@ from __future__ import absolute_import, unicode_literals
 from collections import Mapping, MutableMapping
 
 from case import Mock
+
 from celery.app.utils import Settings, bugreport, filter_hidden_settings
 
 

+ 1 - 0
t/unit/apps/test_multi.py

@@ -6,6 +6,7 @@ import sys
 
 import pytest
 from case import Mock, call, patch, skip
+
 from celery.apps.multi import (Cluster, MultiParser, NamespacedOptionParser,
                                Node, format_opt)
 

+ 1 - 0
t/unit/backends/test_amqp.py

@@ -8,6 +8,7 @@ from pickle import dumps, loads
 import pytest
 from billiard.einfo import ExceptionInfo
 from case import Mock, mock
+
 from celery import states, uuid
 from celery.backends.amqp import AMQPBackend
 from celery.five import Empty, Queue, range

+ 3 - 2
t/unit/backends/test_base.py

@@ -6,6 +6,7 @@ from contextlib import contextmanager
 
 import pytest
 from case import ANY, Mock, call, patch, skip
+
 from celery import chord, group, states, uuid
 from celery.backends.base import (BaseBackend, DisabledBackend,
                                   KeyValueStoreBackend, _nulldict)
@@ -14,10 +15,10 @@ from celery.five import bytes_if_py2, items, range
 from celery.result import result_from_tuple
 from celery.utils import serialization
 from celery.utils.functional import pass1
+from celery.utils.serialization import UnpickleableExceptionWrapper
 from celery.utils.serialization import find_pickleable_exception as fnpe
 from celery.utils.serialization import get_pickleable_exception as gpe
-from celery.utils.serialization import (UnpickleableExceptionWrapper,
-                                        subclass_exception)
+from celery.utils.serialization import subclass_exception
 
 
 class wrapobject(object):

+ 2 - 1
t/unit/backends/test_cache.py

@@ -6,11 +6,12 @@ from contextlib import contextmanager
 
 import pytest
 from case import Mock, mock, patch, skip
+from kombu.utils.encoding import ensure_bytes, str_to_bytes
+
 from celery import group, signature, states, uuid
 from celery.backends.cache import CacheBackend, DummyClient, backends
 from celery.exceptions import ImproperlyConfigured
 from celery.five import bytes_if_py2, items, string, text_t
-from kombu.utils.encoding import ensure_bytes, str_to_bytes
 
 PY3 = sys.version_info[0] == 3
 

+ 1 - 0
t/unit/backends/test_cassandra.py

@@ -5,6 +5,7 @@ from pickle import dumps, loads
 
 import pytest
 from case import Mock, mock
+
 from celery import states
 from celery.exceptions import ImproperlyConfigured
 from celery.utils.objects import Bunch

+ 1 - 0
t/unit/backends/test_consul.py

@@ -1,6 +1,7 @@
 from __future__ import absolute_import, unicode_literals
 
 from case import Mock, skip
+
 from celery.backends.consul import ConsulBackend
 
 

+ 2 - 1
t/unit/backends/test_couchbase.py

@@ -3,11 +3,12 @@ from __future__ import absolute_import, unicode_literals
 
 import pytest
 from case import MagicMock, Mock, patch, sentinel, skip
+from kombu.utils.encoding import str_t
+
 from celery.app import backends
 from celery.backends import couchbase as module
 from celery.backends.couchbase import CouchbaseBackend
 from celery.exceptions import ImproperlyConfigured
-from kombu.utils.encoding import str_t
 
 try:
     import couchbase

+ 1 - 0
t/unit/backends/test_couchdb.py

@@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals
 
 import pytest
 from case import MagicMock, Mock, sentinel, skip
+
 from celery.app import backends
 from celery.backends import couchdb as module
 from celery.backends.couchdb import CouchBackend

+ 1 - 0
t/unit/backends/test_database.py

@@ -5,6 +5,7 @@ from pickle import dumps, loads
 
 import pytest
 from case import Mock, patch, skip
+
 from celery import states, uuid
 from celery.exceptions import ImproperlyConfigured
 

+ 1 - 0
t/unit/backends/test_dynamodb.py

@@ -5,6 +5,7 @@ from decimal import Decimal
 
 import pytest
 from case import MagicMock, Mock, patch, sentinel, skip
+
 from celery.backends import dynamodb as module
 from celery.backends.dynamodb import DynamoDBBackend
 from celery.exceptions import ImproperlyConfigured

+ 1 - 0
t/unit/backends/test_elasticsearch.py

@@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals
 
 import pytest
 from case import Mock, sentinel, skip
+
 from celery.app import backends
 from celery.backends import elasticsearch as module
 from celery.backends.elasticsearch import ElasticsearchBackend

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است