Skip to content

Commit

Permalink
Install isort from git. Fix import order.
Browse files Browse the repository at this point in the history
  • Loading branch information
Omer Katz committed Nov 28, 2017
1 parent 7c86c96 commit 1207709
Show file tree
Hide file tree
Showing 175 changed files with 368 additions and 194 deletions.
9 changes: 5 additions & 4 deletions celery/app/amqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@
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
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

Expand Down
17 changes: 9 additions & 8 deletions celery/app/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
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,
Expand All @@ -28,14 +37,6 @@
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
Expand Down
5 changes: 3 additions & 2 deletions celery/app/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
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 = """\
Expand Down
3 changes: 2 additions & 1 deletion celery/app/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
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
Expand All @@ -24,7 +26,6 @@
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')

Expand Down
3 changes: 2 additions & 1 deletion celery/app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
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')

Expand Down
5 changes: 3 additions & 2 deletions celery/app/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
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
Expand All @@ -17,8 +20,6 @@
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
Expand Down
11 changes: 6 additions & 5 deletions celery/app/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
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
Expand All @@ -26,10 +31,6 @@
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.
Expand Down
3 changes: 2 additions & 1 deletion celery/app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
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)
Expand Down
5 changes: 3 additions & 2 deletions celery/apps/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
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')

Expand Down
3 changes: 2 additions & 1 deletion celery/apps/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
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
Expand All @@ -29,7 +31,6 @@
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',)

Expand Down
3 changes: 2 additions & 1 deletion celery/backends/amqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
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

Expand Down
5 changes: 3 additions & 2 deletions celery/backends/async.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
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',
Expand Down
9 changes: 5 additions & 4 deletions celery/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
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,
Expand All @@ -28,10 +33,6 @@
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')

Expand Down
5 changes: 3 additions & 2 deletions celery/backends/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

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',)
Expand Down
3 changes: 2 additions & 1 deletion celery/backends/consul.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion celery/backends/couchbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

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:
Expand Down
3 changes: 2 additions & 1 deletion celery/backends/couchdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions celery/backends/database/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

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')
Expand Down
1 change: 0 additions & 1 deletion celery/backends/database/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion celery/backends/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
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

Expand Down
5 changes: 3 additions & 2 deletions celery/backends/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

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:
Expand Down
3 changes: 2 additions & 1 deletion celery/backends/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
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:
Expand Down
7 changes: 4 additions & 3 deletions celery/backends/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

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:
Expand Down
Loading

0 comments on commit 1207709

Please sign in to comment.