From 778ef8ec1d3c48f849aa13bee9f88419baeeb969 Mon Sep 17 00:00:00 2001 From: Omer Katz Date: Thu, 5 Dec 2019 19:31:03 +0200 Subject: [PATCH] Fix unused imports. --- celery/utils/__init__.py | 37 ++++++++++++++++++++++++++----------- celery/utils/log.py | 3 +-- t/unit/tasks/test_tasks.py | 2 +- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/celery/utils/__init__.py b/celery/utils/__init__.py index ae0679f4e06..5c7a0c16958 100644 --- a/celery/utils/__init__.py +++ b/celery/utils/__init__.py @@ -6,21 +6,36 @@ """ from __future__ import absolute_import, print_function, unicode_literals -from kombu.utils.objects import cached_property # noqa: F401 -from kombu.utils.uuid import uuid # noqa: F401 +from kombu.utils.objects import cached_property +from kombu.utils.uuid import uuid from .functional import chunks, noop -from .imports import gen_task_name, import_from_cwd, instantiate # noqa: F401 -from .imports import qualname as get_full_cls_name # noqa: F401 -from .imports import symbol_by_name as get_cls_by_name # noqa: F401 +from .functional import memoize +from .imports import gen_task_name, import_from_cwd, instantiate +from .imports import qualname as get_full_cls_name +from .imports import symbol_by_name as get_cls_by_name # ------------------------------------------------------------------------ # # > XXX Compat -from .log import LOG_LEVELS # noqa +from .log import LOG_LEVELS from .nodenames import nodename, nodesplit, worker_direct -from .functional import memoize # noqa: F401; noqa: F401 - -__all__ = ('worker_direct', 'gen_task_name', 'nodename', 'nodesplit', - 'cached_property', 'uuid') - gen_unique_id = uuid + +__all__ = ( + 'LOG_LEVELS', + 'cached_property', + 'chunks', + 'gen_task_name', + 'gen_task_name', + 'gen_unique_id', + 'get_cls_by_name', + 'get_full_cls_name', + 'import_from_cwd', + 'instantiate', + 'memoize', + 'nodename', + 'nodesplit', + 'noop', + 'uuid', + 'worker_direct' +) diff --git a/celery/utils/log.py b/celery/utils/log.py index d846c7bd0de..59e7311bde7 100644 --- a/celery/utils/log.py +++ b/celery/utils/log.py @@ -16,14 +16,13 @@ from kombu.utils.encoding import safe_str from celery.five import string_t, text_t - from .term import colored __all__ = ( 'ColorFormatter', 'LoggingProxy', 'base_logger', 'set_in_sighandler', 'in_sighandler', 'get_logger', 'get_task_logger', 'mlevel', - 'get_multiprocessing_logger', 'reset_multiprocessing_logger', + 'get_multiprocessing_logger', 'reset_multiprocessing_logger', 'LOG_LEVELS' ) _process_aware = False diff --git a/t/unit/tasks/test_tasks.py b/t/unit/tasks/test_tasks.py index 01e06dd21b5..5349b784418 100644 --- a/t/unit/tasks/test_tasks.py +++ b/t/unit/tasks/test_tasks.py @@ -214,7 +214,7 @@ def test_retry(self): def test_retry_priority(self): priority = 7 - + # Technically, task.priority doesn't need to be set here # since push_request() doesn't populate the delivery_info # with it. However, setting task.priority here also doesn't