diff options
author | Cao Xuan Hoang <hoangcx@vn.fujitsu.com> | 2017-07-06 09:05:14 +0700 |
---|---|---|
committer | Cao Xuan Hoang <hoangcx@vn.fujitsu.com> | 2017-07-06 16:47:49 +0700 |
commit | f4c0468b3667f4a967e2a0402c0f49dcca55e29f (patch) | |
tree | 9388a1b8e259aaf1695b7cd968e85be213a6557a | |
parent | 53e55938d97a4a26be218b709d32a1a251328225 (diff) | |
download | python-neutronclient-f4c0468b3667f4a967e2a0402c0f49dcca55e29f.tar.gz |
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.
It enforces loose checking so it sounds good to use it.
This flake8 plugin is already used in tempest.
Note that flake8-import-order version is pinned to avoid unexpected
breakage of pep8 job.
Setup for unit tests of hacking rules is tweaked to disable
flake8-import-order checks. This extension assumes an actual file
exists and causes hacking rule unit tests.
Change-Id: I61e683ab0119e4ae90b7107f0690528d789e3875
13 files changed, 18 insertions, 11 deletions
diff --git a/neutronclient/neutron/v2_0/auto_allocated_topology.py b/neutronclient/neutron/v2_0/auto_allocated_topology.py index 12ca4db..ef0da43 100644 --- a/neutronclient/neutron/v2_0/auto_allocated_topology.py +++ b/neutronclient/neutron/v2_0/auto_allocated_topology.py @@ -17,6 +17,7 @@ from __future__ import print_function import argparse + from cliff import show from oslo_serialization import jsonutils diff --git a/neutronclient/tests/unit/osc/v2/fakes.py b/neutronclient/tests/unit/osc/v2/fakes.py index cc30842..afa81e7 100644 --- a/neutronclient/tests/unit/osc/v2/fakes.py +++ b/neutronclient/tests/unit/osc/v2/fakes.py @@ -12,9 +12,9 @@ # import argparse -import mock from cliff import columns as cliff_columns +import mock from osc_lib.tests import utils diff --git a/neutronclient/tests/unit/osc/v2/fwaas/fakes.py b/neutronclient/tests/unit/osc/v2/fwaas/fakes.py index 7a22ab1..7baef84 100644 --- a/neutronclient/tests/unit/osc/v2/fwaas/fakes.py +++ b/neutronclient/tests/unit/osc/v2/fwaas/fakes.py @@ -16,9 +16,10 @@ import collections import copy -import mock import uuid +import mock + class FakeFWaaS(object): diff --git a/neutronclient/tests/unit/osc/v2/fwaas/test_firewallgroup.py b/neutronclient/tests/unit/osc/v2/fwaas/test_firewallgroup.py index 0a15f2b..87fb4c2 100644 --- a/neutronclient/tests/unit/osc/v2/fwaas/test_firewallgroup.py +++ b/neutronclient/tests/unit/osc/v2/fwaas/test_firewallgroup.py @@ -15,9 +15,9 @@ # import copy -import mock import re +import mock from osc_lib import exceptions from osc_lib.tests import utils diff --git a/neutronclient/tests/unit/osc/v2/fwaas/test_firewallpolicy.py b/neutronclient/tests/unit/osc/v2/fwaas/test_firewallpolicy.py index 6d97807..c2e9b1b 100644 --- a/neutronclient/tests/unit/osc/v2/fwaas/test_firewallpolicy.py +++ b/neutronclient/tests/unit/osc/v2/fwaas/test_firewallpolicy.py @@ -15,9 +15,9 @@ # import copy -import mock import re +import mock from osc_lib import exceptions from osc_lib.tests import utils diff --git a/neutronclient/tests/unit/osc/v2/fwaas/test_firewallrule.py b/neutronclient/tests/unit/osc/v2/fwaas/test_firewallrule.py index d09bbbe..94e1199 100644 --- a/neutronclient/tests/unit/osc/v2/fwaas/test_firewallrule.py +++ b/neutronclient/tests/unit/osc/v2/fwaas/test_firewallrule.py @@ -15,12 +15,12 @@ # import copy -import mock import re -import testtools +import mock from osc_lib import exceptions from osc_lib.tests import utils +import testtools from neutronclient.osc import utils as osc_utils from neutronclient.osc.v2.fwaas import constants as const diff --git a/neutronclient/tests/unit/osc/v2/networking_bgpvpn/fakes.py b/neutronclient/tests/unit/osc/v2/networking_bgpvpn/fakes.py index 6138fea..7da3a98 100644 --- a/neutronclient/tests/unit/osc/v2/networking_bgpvpn/fakes.py +++ b/neutronclient/tests/unit/osc/v2/networking_bgpvpn/fakes.py @@ -15,6 +15,7 @@ # import copy + import mock from neutronclient.osc import utils as nc_osc_utils diff --git a/neutronclient/tests/unit/osc/v2/networking_bgpvpn/test_bgpvpn.py b/neutronclient/tests/unit/osc/v2/networking_bgpvpn/test_bgpvpn.py index aa68827..f13980e 100644 --- a/neutronclient/tests/unit/osc/v2/networking_bgpvpn/test_bgpvpn.py +++ b/neutronclient/tests/unit/osc/v2/networking_bgpvpn/test_bgpvpn.py @@ -15,9 +15,9 @@ # import copy -import mock import operator +import mock from osc_lib import exceptions from osc_lib import utils as osc_utils diff --git a/neutronclient/tests/unit/osc/v2/networking_bgpvpn/test_resource_association.py b/neutronclient/tests/unit/osc/v2/networking_bgpvpn/test_resource_association.py index e7bc8ce..6978d85 100644 --- a/neutronclient/tests/unit/osc/v2/networking_bgpvpn/test_resource_association.py +++ b/neutronclient/tests/unit/osc/v2/networking_bgpvpn/test_resource_association.py @@ -15,9 +15,9 @@ # import copy -import mock import operator +import mock from osc_lib import exceptions from osc_lib import utils as osc_utils diff --git a/neutronclient/tests/unit/osc/v2/trunk/fakes.py b/neutronclient/tests/unit/osc/v2/trunk/fakes.py index 4ae1f28..12f773f 100644 --- a/neutronclient/tests/unit/osc/v2/trunk/fakes.py +++ b/neutronclient/tests/unit/osc/v2/trunk/fakes.py @@ -11,9 +11,10 @@ # under the License. import copy -import mock import uuid +import mock + class FakeTrunk(object): """Fake one or more trunks.""" diff --git a/neutronclient/tests/unit/osc/v2/trunk/test_network_trunk.py b/neutronclient/tests/unit/osc/v2/trunk/test_network_trunk.py index 8b7aaa0..8e9e73c 100644 --- a/neutronclient/tests/unit/osc/v2/trunk/test_network_trunk.py +++ b/neutronclient/tests/unit/osc/v2/trunk/test_network_trunk.py @@ -15,13 +15,13 @@ import argparse import copy + import mock from mock import call -import testtools - from osc_lib.cli import format_columns from osc_lib import exceptions from osc_lib.tests import utils as tests_utils +import testtools from neutronclient.osc.v2.trunk import network_trunk as trunk from neutronclient.osc.v2 import utils as v2_utils diff --git a/test-requirements.txt b/test-requirements.txt index 85ccf05..ae28566 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,6 +5,7 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD +flake8-import-order==0.12 # LGPLv3 mox3!=0.19.0,>=0.7.0 # Apache-2.0 mock>=2.0 # BSD openstackdocstheme>=1.11.0 # Apache-2.0 @@ -55,5 +55,7 @@ commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenote [flake8] show-source = true exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools +import-order-style = pep8 + # H904: Delay string interpolations at logging calls enable-extensions=H904 |