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: I12b596820727aeeb379bee16c2bc993dee9eb637
This commit is contained in:
parent
53bea90a75
commit
f3bbf52b3c
@ -16,11 +16,11 @@
|
|||||||
"""Manage access to the clients, including authenticating when needed."""
|
"""Manage access to the clients, including authenticating when needed."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import pkg_resources
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from osc_lib import clientmanager
|
from osc_lib import clientmanager
|
||||||
from osc_lib import shell
|
from osc_lib import shell
|
||||||
|
import pkg_resources
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
@ -16,10 +16,10 @@
|
|||||||
"""Compute v2 Server operation event implementations"""
|
"""Compute v2 Server operation event implementations"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import six
|
|
||||||
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
import six
|
||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@ import os
|
|||||||
import re
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
import testtools
|
|
||||||
|
|
||||||
from tempest.lib.cli import output_parser
|
from tempest.lib.cli import output_parser
|
||||||
from tempest.lib import exceptions
|
from tempest.lib import exceptions
|
||||||
|
import testtools
|
||||||
|
|
||||||
|
|
||||||
COMMON_DIR = os.path.dirname(os.path.abspath(__file__))
|
COMMON_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
# or Jun 2017.
|
# or Jun 2017.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from openstackclient.common import logs
|
from openstackclient.common import logs
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
|
|
||||||
|
import mock
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
|
|
||||||
from openstackclient.common import quota
|
from openstackclient.common import quota
|
||||||
|
@ -14,9 +14,10 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
import mock
|
||||||
|
|
||||||
from openstackclient.api import compute_v2
|
from openstackclient.api import compute_v2
|
||||||
from openstackclient.tests.unit import fakes
|
from openstackclient.tests.unit import fakes
|
||||||
from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes
|
from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import mock
|
|
||||||
from mock import call
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
import mock
|
||||||
|
from mock import call
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import collections
|
import collections
|
||||||
import getpass
|
import getpass
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from mock import call
|
from mock import call
|
||||||
|
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils as common_utils
|
from osc_lib import utils as common_utils
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from openstackclient.compute.v2 import usage
|
from openstackclient.compute.v2 import usage
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import mock
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from keystoneauth1 import fixture
|
from keystoneauth1 import fixture
|
||||||
|
import mock
|
||||||
import requests
|
import requests
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
@ -14,11 +14,11 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from keystoneauth1 import access
|
from keystoneauth1 import access
|
||||||
from keystoneauth1 import fixture
|
from keystoneauth1 import fixture
|
||||||
|
import mock
|
||||||
|
|
||||||
from openstackclient.tests.unit import fakes
|
from openstackclient.tests.unit import fakes
|
||||||
from openstackclient.tests.unit import utils
|
from openstackclient.tests.unit import utils
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
|
|
||||||
|
import mock
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
|
|
||||||
from openstackclient.identity.v2_0 import role_assignment
|
from openstackclient.identity.v2_0 import role_assignment
|
||||||
|
@ -14,11 +14,11 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from keystoneauth1 import access
|
from keystoneauth1 import access
|
||||||
from keystoneauth1 import fixture
|
from keystoneauth1 import fixture
|
||||||
|
import mock
|
||||||
|
|
||||||
from openstackclient.tests.unit import fakes
|
from openstackclient.tests.unit import fakes
|
||||||
from openstackclient.tests.unit import utils
|
from openstackclient.tests.unit import utils
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from openstackclient.identity.v3 import identity_provider
|
from openstackclient.identity.v3 import identity_provider
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
|
|
||||||
|
import mock
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
|
|
||||||
from openstackclient.identity.v3 import mapping
|
from openstackclient.identity.v3 import mapping
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
|
|
||||||
|
import mock
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from openstackclient.identity.v3 import role_assignment
|
from openstackclient.identity.v3 import role_assignment
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
|
|
||||||
|
import mock
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import mock
|
|
||||||
|
|
||||||
|
import mock
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
|
@ -14,9 +14,10 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
import mock
|
||||||
|
|
||||||
from openstackclient.tests.unit import fakes
|
from openstackclient.tests.unit import fakes
|
||||||
from openstackclient.tests.unit import utils
|
from openstackclient.tests.unit import utils
|
||||||
from openstackclient.tests.unit.volume.v1 import fakes as volume_fakes
|
from openstackclient.tests.unit.volume.v1 import fakes as volume_fakes
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
|
|
||||||
|
import mock
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
|
@ -14,11 +14,11 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
import random
|
import random
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from glanceclient.v2 import schemas
|
from glanceclient.v2 import schemas
|
||||||
|
import mock
|
||||||
from osc_lib import utils as common_utils
|
from osc_lib import utils as common_utils
|
||||||
import warlock
|
import warlock
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
|
|
||||||
from glanceclient.v2 import schemas
|
from glanceclient.v2 import schemas
|
||||||
|
import mock
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils as common_utils
|
from osc_lib import utils as common_utils
|
||||||
import warlock
|
import warlock
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
|
|
||||||
|
import mock
|
||||||
from osc_lib.tests import utils as osc_lib_utils
|
from osc_lib.tests import utils as osc_lib_utils
|
||||||
|
|
||||||
from openstackclient import shell
|
from openstackclient import shell
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
import openstack
|
import openstack
|
||||||
|
@ -13,11 +13,12 @@
|
|||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
from random import choice
|
from random import choice
|
||||||
from random import randint
|
from random import randint
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
import mock
|
||||||
|
|
||||||
from openstackclient.tests.unit import fakes
|
from openstackclient.tests.unit import fakes
|
||||||
from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes_v3
|
from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes_v3
|
||||||
from openstackclient.tests.unit import utils
|
from openstackclient.tests.unit import utils
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import mock
|
|
||||||
from mock import call
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
import mock
|
||||||
|
from mock import call
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import mock
|
|
||||||
|
|
||||||
|
import mock
|
||||||
from mock import call
|
from mock import call
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from mock import call
|
from mock import call
|
||||||
|
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from openstackclient.api import object_store_v1 as object_store
|
from openstackclient.api import object_store_v1 as object_store
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from openstackclient.api import object_store_v1 as object_store
|
from openstackclient.api import object_store_v1 as object_store
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import mock
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import mock
|
||||||
from osc_lib.tests import utils as osc_lib_test_utils
|
from osc_lib.tests import utils as osc_lib_test_utils
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
import wrapt
|
import wrapt
|
||||||
|
@ -14,8 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import fixtures
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
import fixtures
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
from openstackclient.tests.unit import fakes
|
from openstackclient.tests.unit import fakes
|
||||||
|
@ -14,10 +14,11 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
import random
|
import random
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
import mock
|
||||||
|
|
||||||
from openstackclient.tests.unit import fakes
|
from openstackclient.tests.unit import fakes
|
||||||
from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes
|
from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes
|
||||||
from openstackclient.tests.unit import utils
|
from openstackclient.tests.unit import utils
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from mock import call
|
from mock import call
|
||||||
|
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from mock import call
|
from mock import call
|
||||||
|
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import mock
|
|
||||||
import random
|
import random
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
import mock
|
||||||
from osc_lib import utils as common_utils
|
from osc_lib import utils as common_utils
|
||||||
|
|
||||||
from openstackclient.tests.unit import fakes
|
from openstackclient.tests.unit import fakes
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from mock import call
|
from mock import call
|
||||||
|
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from mock import call
|
from mock import call
|
||||||
|
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from mock import call
|
from mock import call
|
||||||
|
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
|
|||||||
|
|
||||||
coverage!=4.4,>=4.0 # Apache-2.0
|
coverage!=4.4,>=4.0 # Apache-2.0
|
||||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||||
|
flake8-import-order==0.13 # LGPLv3
|
||||||
mock>=2.0 # BSD
|
mock>=2.0 # BSD
|
||||||
openstackdocstheme>=1.16.0 # Apache-2.0
|
openstackdocstheme>=1.16.0 # Apache-2.0
|
||||||
oslotest>=1.10.0 # Apache-2.0
|
oslotest>=1.10.0 # Apache-2.0
|
||||||
|
1
tox.ini
1
tox.ini
@ -91,3 +91,4 @@ exclude = .git,.tox,dist,doc,*lib/python*,*egg,build,tools
|
|||||||
# If 'ignore' is not set there are default errors and warnings that are set
|
# If 'ignore' is not set there are default errors and warnings that are set
|
||||||
# Doc: http://flake8.readthedocs.org/en/latest/config.html#default
|
# Doc: http://flake8.readthedocs.org/en/latest/config.html#default
|
||||||
ignore = __
|
ignore = __
|
||||||
|
import-order-style = pep8
|
||||||
|
Loading…
Reference in New Issue
Block a user