From 01f2a69a64ed64a2b8e6a3fc67836ea0f926c42a Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Sun, 2 Jul 2017 10:50:06 +0000 Subject: [PATCH] Use flake8-import-order plugin In reviews we usually check import grouping but it is boring. By using flake8-import-order plugin, we can avoid this. This flake8 plugin is already used in tempest. It enforces loose checking so it sounds good to use. Note that flake8-import-order version is pinned to avoid unexpected breakage of pep8 job. Change-Id: I8ccd05eb70350a2441cc2a4d1eafc09ee690b83b --- openstack_dashboard/api/heat.py | 8 ++++---- openstack_dashboard/test/api_tests/heat_rest_tests.py | 1 + openstack_dashboard/test/helpers.py | 2 +- tox.ini | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/openstack_dashboard/api/heat.py b/openstack_dashboard/api/heat.py index 38f554ae..c31c61da 100644 --- a/openstack_dashboard/api/heat.py +++ b/openstack_dashboard/api/heat.py @@ -11,16 +11,16 @@ # under the License. import contextlib -import six -from six.moves.urllib import request from django.conf import settings -from oslo_serialization import jsonutils - from heatclient import client as heat_client from heatclient.common import template_format from heatclient.common import template_utils from heatclient.common import utils as heat_utils +from oslo_serialization import jsonutils +import six +from six.moves.urllib import request + from horizon import exceptions from horizon.utils import functions as utils from horizon.utils.memoized import memoized diff --git a/openstack_dashboard/test/api_tests/heat_rest_tests.py b/openstack_dashboard/test/api_tests/heat_rest_tests.py index 40d7ed35..ef5cc0f7 100644 --- a/openstack_dashboard/test/api_tests/heat_rest_tests.py +++ b/openstack_dashboard/test/api_tests/heat_rest_tests.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import json + import mock from openstack_dashboard import api diff --git a/openstack_dashboard/test/helpers.py b/openstack_dashboard/test/helpers.py index 50a1044a..24af4fae 100644 --- a/openstack_dashboard/test/helpers.py +++ b/openstack_dashboard/test/helpers.py @@ -19,6 +19,7 @@ import collections import copy from functools import wraps +from importlib import import_module import os import traceback import unittest @@ -35,7 +36,6 @@ from django.utils import http from cinderclient import client as cinder_client import glanceclient from heatclient import client as heat_client -from importlib import import_module from keystoneclient.v2_0 import client as keystone_client import mock from mox3 import mox diff --git a/tox.ini b/tox.ini index b76cd742..e2023735 100644 --- a/tox.ini +++ b/tox.ini @@ -123,6 +123,7 @@ ignore = # H904 Delay string interpolations at logging calls enable-extensions=H203,H904 max-complexity = 20 +import-order-style = pep8 [hacking] local-check-factory = horizon.hacking.checks.factory