Add pep8 import order validation

Add the flake8-import-order library to our test requirements so that we
can avoid these PEP8 violations and maintain consistent import ordering.
Also fix our violations.

This library is in requirements but is blacklisted from being
automatically updated since it is never shipped. For now, don't bother
to pin it.

Change-Id: I4e788292b98b7f2f835cc80081763b2d249fe43e
This commit is contained in:
Colleen Murphy 2018-02-15 20:07:04 +01:00
parent 96de6d3376
commit 8bd6312ebc
7 changed files with 9 additions and 5 deletions

View File

@ -11,6 +11,7 @@
# under the License.
import abc
import six
from keystoneauth1 import _utils as utils

View File

@ -10,9 +10,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import datetime
import uuid
import datetime
from oslo_utils import timeutils
from keystoneauth1 import access

View File

@ -10,11 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import testtools
import betamax
from betamax import exceptions
import mock
import testtools
from keystoneauth1.fixture import keystoneauth_betamax
from keystoneauth1.fixture import serializer

View File

@ -10,8 +10,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import betamax
import json
import betamax
import mock
from requests import models
import testtools

View File

@ -11,9 +11,9 @@
# under the License.
import json
import mock
import re
import mock
from testtools import matchers
from keystoneauth1 import adapter

View File

@ -4,6 +4,7 @@
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
flake8-docstrings==0.2.1.post1 # MIT
flake8-import-order
bandit>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0

View File

@ -61,6 +61,8 @@ ignore = D100,D101,D102,D103,D104,D203
enable-extensions=H106,H203
show-source = True
exclude = .venv,.tox,dist,doc,*egg,build
import-order-style = pep8
application-import-names = keystoneauth1
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt