From cb0ebb9e6c64cfdfedc31b6f8ad9e6474d4e570e Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Mon, 30 Dec 2013 14:40:42 -0800 Subject: [PATCH] Move six to the right location Third party imports are supposed to be after standard library imports so make six be after. Some newlines are also added to separate standard library imports from all the others. Co-authored-by: Ivan A. Melnikov Change-Id: Ied067e9367612758666da726df195ed390215e1b --- taskflow/engines/action_engine/executor.py | 2 +- taskflow/flow.py | 1 + taskflow/persistence/backends/__init__.py | 1 + taskflow/persistence/backends/impl_dir.py | 3 ++- taskflow/persistence/logbook.py | 1 + taskflow/storage.py | 1 + taskflow/tests/test_examples.py | 1 + taskflow/tests/unit/test_green_executor.py | 1 + taskflow/tests/unit/test_storage.py | 1 + taskflow/tests/unit/test_suspend_flow.py | 7 +++---- taskflow/tests/utils.py | 3 ++- taskflow/utils/graph_utils.py | 6 ++---- taskflow/utils/misc.py | 3 ++- taskflow/utils/reflection.py | 3 ++- taskflow/utils/threading_utils.py | 3 ++- 15 files changed, 23 insertions(+), 14 deletions(-) diff --git a/taskflow/engines/action_engine/executor.py b/taskflow/engines/action_engine/executor.py index b771dc4cd..391128c8a 100644 --- a/taskflow/engines/action_engine/executor.py +++ b/taskflow/engines/action_engine/executor.py @@ -18,9 +18,9 @@ import abc import contextlib -import six from concurrent import futures +import six from taskflow.utils import async_utils from taskflow.utils import misc diff --git a/taskflow/flow.py b/taskflow/flow.py index 72731b02d..fbe7fc56f 100644 --- a/taskflow/flow.py +++ b/taskflow/flow.py @@ -17,6 +17,7 @@ # under the License. import abc + import six from taskflow.utils import reflection diff --git a/taskflow/persistence/backends/__init__.py b/taskflow/persistence/backends/__init__.py index cf3a815df..605e9afc5 100644 --- a/taskflow/persistence/backends/__init__.py +++ b/taskflow/persistence/backends/__init__.py @@ -17,6 +17,7 @@ # under the License. import logging + from stevedore import driver from taskflow import exceptions as exc diff --git a/taskflow/persistence/backends/impl_dir.py b/taskflow/persistence/backends/impl_dir.py index 3127f59de..635cb2b10 100644 --- a/taskflow/persistence/backends/impl_dir.py +++ b/taskflow/persistence/backends/impl_dir.py @@ -21,10 +21,11 @@ import errno import logging import os import shutil -import six import threading import weakref +import six + from taskflow import exceptions as exc from taskflow.openstack.common import jsonutils from taskflow.openstack.common import timeutils diff --git a/taskflow/persistence/logbook.py b/taskflow/persistence/logbook.py index 577ccffce..e1e7ba9b7 100644 --- a/taskflow/persistence/logbook.py +++ b/taskflow/persistence/logbook.py @@ -18,6 +18,7 @@ # under the License. import logging + import six from taskflow.openstack.common import uuidutils diff --git a/taskflow/storage.py b/taskflow/storage.py index b4b9f3f5a..482adbf56 100644 --- a/taskflow/storage.py +++ b/taskflow/storage.py @@ -18,6 +18,7 @@ import contextlib import logging + import six from taskflow import exceptions diff --git a/taskflow/tests/test_examples.py b/taskflow/tests/test_examples.py index 31cc21a81..dae1fdb26 100644 --- a/taskflow/tests/test_examples.py +++ b/taskflow/tests/test_examples.py @@ -34,6 +34,7 @@ import os import re import subprocess import sys + import taskflow.test ROOT_DIR = os.path.abspath( diff --git a/taskflow/tests/unit/test_green_executor.py b/taskflow/tests/unit/test_green_executor.py index 3a9833b19..f57dbbab6 100644 --- a/taskflow/tests/unit/test_green_executor.py +++ b/taskflow/tests/unit/test_green_executor.py @@ -18,6 +18,7 @@ import collections import functools + import testtools from taskflow import test diff --git a/taskflow/tests/unit/test_storage.py b/taskflow/tests/unit/test_storage.py index 23af161ad..fa0483628 100644 --- a/taskflow/tests/unit/test_storage.py +++ b/taskflow/tests/unit/test_storage.py @@ -17,6 +17,7 @@ # under the License. import contextlib + import mock from taskflow import exceptions diff --git a/taskflow/tests/unit/test_suspend_flow.py b/taskflow/tests/unit/test_suspend_flow.py index 72d53ca59..843bdfa72 100644 --- a/taskflow/tests/unit/test_suspend_flow.py +++ b/taskflow/tests/unit/test_suspend_flow.py @@ -16,19 +16,18 @@ # License for the specific language governing permissions and limitations # under the License. -import testtools import time -from taskflow.patterns import linear_flow as lf -from taskflow.utils import eventlet_utils as eu +import testtools import taskflow.engines - from taskflow import exceptions as exc +from taskflow.patterns import linear_flow as lf from taskflow import states from taskflow import task from taskflow import test from taskflow.tests import utils +from taskflow.utils import eventlet_utils as eu class TestTask(task.Task): diff --git a/taskflow/tests/utils.py b/taskflow/tests/utils.py index 53a17a441..43daf3983 100644 --- a/taskflow/tests/utils.py +++ b/taskflow/tests/utils.py @@ -17,9 +17,10 @@ # under the License. import contextlib -import six import time +import six + from taskflow.persistence.backends import impl_memory from taskflow import task diff --git a/taskflow/utils/graph_utils.py b/taskflow/utils/graph_utils.py index 40c151f5a..e0ce99e8f 100644 --- a/taskflow/utils/graph_utils.py +++ b/taskflow/utils/graph_utils.py @@ -16,10 +16,8 @@ # License for the specific language governing permissions and limitations # under the License. -import six - import networkx as nx -from networkx import algorithms +import six def get_edge_attrs(graph, u, v): @@ -47,7 +45,7 @@ def merge_graphs(graphs, allow_overlaps=False): len(overlaps))) # Keep the target graphs name. name = graph.name - graph = algorithms.compose(graph, g) + graph = nx.algorithms.compose(graph, g) graph.name = name return graph diff --git a/taskflow/utils/misc.py b/taskflow/utils/misc.py index a74acc92f..ecb5aa682 100644 --- a/taskflow/utils/misc.py +++ b/taskflow/utils/misc.py @@ -24,12 +24,13 @@ import functools import keyword import logging import os -import six import string import sys import time import traceback +import six + from taskflow import exceptions from taskflow.utils import reflection diff --git a/taskflow/utils/reflection.py b/taskflow/utils/reflection.py index 22900ab77..0674628f2 100644 --- a/taskflow/utils/reflection.py +++ b/taskflow/utils/reflection.py @@ -17,9 +17,10 @@ # under the License. import inspect -import six import types +import six + def get_member_names(obj, exclude_hidden=True): """Get all the member names for a object.""" diff --git a/taskflow/utils/threading_utils.py b/taskflow/utils/threading_utils.py index bffd037fd..ee82af0ac 100644 --- a/taskflow/utils/threading_utils.py +++ b/taskflow/utils/threading_utils.py @@ -18,10 +18,11 @@ import logging import multiprocessing -import six import threading import types +import six + from taskflow.utils import lock_utils LOG = logging.getLogger(__name__)