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
This commit is contained in:
Akihiro Motoki 2017-07-02 10:50:06 +00:00
parent 8cf9fae418
commit e6b78f92f2
26 changed files with 45 additions and 36 deletions
doc/source
horizon
openstack_dashboard
api
dashboards
admin/volumes
project
security_groups
volumes
management/commands
templatetags
test
test-requirements.txttox.ini

@ -24,11 +24,11 @@
from __future__ import print_function
import django
import logging
import os
import sys
import django
# NOTE(amotoki): Sphinx 1.6.x catches warnings from imported modules.
# Ignore warnings from openstack_dashboard.settings in the doc build.

@ -22,6 +22,7 @@ the classes contained therein.
import collections
import copy
from importlib import import_module
import inspect
import logging
import os
@ -37,7 +38,6 @@ from django.utils.functional import empty
from django.utils.functional import SimpleLazyObject
from django.utils.module_loading import module_has_submodule
from django.utils.translation import ugettext_lazy as _
from importlib import import_module
import six
from horizon import conf

@ -11,11 +11,11 @@
# under the License.
import glob
from importlib import import_module
import os
from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
from importlib import import_module
import horizon

@ -11,11 +11,11 @@
# under the License.
import glob
from importlib import import_module
import os
from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
from importlib import import_module
import horizon

@ -15,7 +15,6 @@
from __future__ import absolute_import
from collections import OrderedDict
from horizon.contrib import bootstrap_datepicker
from django.conf import settings
from django import template
@ -26,6 +25,7 @@ from django.utils.translation import ugettext_lazy as _
from horizon.base import Horizon
from horizon import conf
from horizon.contrib import bootstrap_datepicker
register = template.Library()

@ -12,9 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import textwrap
import mock
import pep8
import textwrap
from horizon.hacking import checks
from horizon.test import helpers

@ -17,15 +17,16 @@
# License for the specific language governing permissions and limitations
# under the License.
from importlib import import_module
import six
from six import moves
import django
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured
from django.core import urlresolvers
from importlib import import_module
from six import moves
import six
import horizon
from horizon import base

@ -10,9 +10,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from horizon.utils import file_discovery as fd
import unittest
from horizon.utils import file_discovery as fd
base_path = 'some_root/fake_static_files/'
test_structure = [

@ -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

@ -17,6 +17,7 @@
# under the License.
from datetime import datetime
import six.moves.urllib.parse as urlparse
import swiftclient

@ -16,6 +16,7 @@
Admin views for managing volumes and snapshots.
"""
from collections import OrderedDict
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy

@ -17,6 +17,8 @@
# under the License.
import cgi
from mox3.mox import IsA
import six
import django
@ -24,17 +26,14 @@ from django.conf import settings
from django.core.urlresolvers import reverse
from django import http
from mox3.mox import IsA
from horizon import exceptions
from horizon import forms
from openstack_dashboard import api
from openstack_dashboard.dashboards.project.security_groups import tables
from openstack_dashboard.test import helpers as test
from openstack_dashboard.usage import quotas
from openstack_dashboard.dashboards.project.security_groups import tables
INDEX_URL = reverse('horizon:project:security_groups:index')
SG_CREATE_URL = reverse('horizon:project:security_groups:create')

@ -13,6 +13,8 @@
# under the License.
import copy
from mox3.mox import IsA
import six
from six import moves
@ -25,8 +27,6 @@ from django.template.defaultfilters import slugify
from django.test.utils import override_settings
from django.utils.http import urlunquote
from mox3.mox import IsA
from openstack_dashboard import api
from openstack_dashboard.api import cinder
from openstack_dashboard.dashboards.project.volumes \

@ -15,10 +15,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import babel.messages.catalog as catalog
import os
from subprocess import call
import babel.messages.catalog as catalog
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import translation

@ -16,6 +16,7 @@
from __future__ import absolute_import
import os
from six.moves.urllib.request import pathname2url
from django.conf import settings

@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import json
import mock
from django.conf import settings
import mock
from openstack_dashboard import api
from openstack_dashboard.api.base import Quota

@ -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

@ -11,10 +11,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from json import loads as to_json
from django.conf import settings
from json import loads as to_json
import mock
from openstack_dashboard import api
from openstack_dashboard.api.base import Quota

@ -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

@ -14,7 +14,6 @@ import contextlib
import logging
import os
import shutil
from six import StringIO
import socket
import subprocess
import tempfile
@ -22,10 +21,10 @@ import time
import traceback
from oslo_utils import uuidutils
from selenium.webdriver.common import action_chains
from selenium.webdriver.common import by
from selenium.webdriver.common import keys
from six import StringIO
import testtools
import xvfbwrapper

@ -12,9 +12,9 @@
import importlib
import json
import six
from selenium.webdriver.common import by
import six
from openstack_dashboard.test.integration_tests import config

@ -9,14 +9,15 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from openstack_dashboard.test.integration_tests.pages import basepage
from openstack_dashboard.test.integration_tests.regions import tables
from os import listdir
from os.path import isfile
from os.path import join
from re import search
from openstack_dashboard.test.integration_tests.pages import basepage
from openstack_dashboard.test.integration_tests.regions import tables
class ApiAccessTable(tables.TableRegion):
name = "endpoints"

@ -10,11 +10,11 @@
# License for the specific language governing permissions and limitations
# under the License.
import collections
import six
from selenium.common import exceptions
from selenium.webdriver.common import by
import selenium.webdriver.support.ui as Support
import six
from openstack_dashboard.test.integration_tests.regions import baseregion
from openstack_dashboard.test.integration_tests.regions import menus

@ -10,14 +10,14 @@
# License for the specific language governing permissions and limitations
# under the License.
from horizon.test import firefox_binary
from openstack_dashboard.test.integration_tests import decorators
from openstack_dashboard.test.integration_tests import helpers
from os import listdir
from os.path import join
from os import remove
from horizon.test import firefox_binary
from openstack_dashboard.test.integration_tests import decorators
from openstack_dashboard.test.integration_tests import helpers
class TestDownloadRCFile(helpers.AdminTestCase):

@ -11,6 +11,7 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
#
coverage!=4.4,>=4.0 # Apache-2.0
django-nose>=1.4.4 # BSD
flake8-import-order==0.12 # LGPLv3
mock>=2.0 # BSD
mox3!=0.19.0,>=0.7.0 # Apache-2.0
nodeenv>=0.9.4 # BSD

@ -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