diff --git a/lower-constraints.txt b/lower-constraints.txt index 1b7b83b4..805c577d 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -9,6 +9,7 @@ docutils==0.11 dulwich==0.15.0 extras==1.0.0 fixtures==3.0.0 +flake8-import-order==0.17.1 Flask-SQLAlchemy==2.0 Flask-RESTful==0.3.5 Flask==1.0.2 diff --git a/sushy_tools/emulator/resources/chassis/base.py b/sushy_tools/emulator/resources/chassis/base.py index 5b3fbd48..60685129 100644 --- a/sushy_tools/emulator/resources/chassis/base.py +++ b/sushy_tools/emulator/resources/chassis/base.py @@ -14,6 +14,7 @@ # under the License. import abc + import six from sushy_tools.emulator import base diff --git a/sushy_tools/emulator/resources/managers/base.py b/sushy_tools/emulator/resources/managers/base.py index c6dc767b..9dfbcfdb 100644 --- a/sushy_tools/emulator/resources/managers/base.py +++ b/sushy_tools/emulator/resources/managers/base.py @@ -14,6 +14,7 @@ # under the License. import abc + import six from sushy_tools.emulator import base diff --git a/sushy_tools/emulator/resources/systems/base.py b/sushy_tools/emulator/resources/systems/base.py index db40533d..a1571930 100644 --- a/sushy_tools/emulator/resources/systems/base.py +++ b/sushy_tools/emulator/resources/systems/base.py @@ -14,6 +14,7 @@ # under the License. import abc + import six from sushy_tools.emulator.resources.base import DriverBase diff --git a/sushy_tools/emulator/resources/volumes/staticdriver.py b/sushy_tools/emulator/resources/volumes/staticdriver.py index 3e1d5ebe..cdb67c35 100644 --- a/sushy_tools/emulator/resources/volumes/staticdriver.py +++ b/sushy_tools/emulator/resources/volumes/staticdriver.py @@ -12,9 +12,11 @@ # 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 uuid + from sushy_tools.emulator import memoize from sushy_tools.emulator.resources.base import DriverBase -import uuid class StaticDriver(DriverBase): diff --git a/sushy_tools/tests/unit/emulator/resources/chassis/test_static.py b/sushy_tools/tests/unit/emulator/resources/chassis/test_static.py index 64fbe6f5..57f647d0 100644 --- a/sushy_tools/tests/unit/emulator/resources/chassis/test_static.py +++ b/sushy_tools/tests/unit/emulator/resources/chassis/test_static.py @@ -14,12 +14,12 @@ # under the License. import uuid -from sushy_tools.emulator.resources.chassis.staticdriver import StaticDriver -from sushy_tools import error - from oslotest import base from six.moves import mock +from sushy_tools.emulator.resources.chassis.staticdriver import StaticDriver +from sushy_tools import error + class StaticDriverTestCase(base.BaseTestCase): diff --git a/sushy_tools/tests/unit/emulator/resources/drives/test_static.py b/sushy_tools/tests/unit/emulator/resources/drives/test_static.py index bbed5271..5faa6476 100644 --- a/sushy_tools/tests/unit/emulator/resources/drives/test_static.py +++ b/sushy_tools/tests/unit/emulator/resources/drives/test_static.py @@ -12,11 +12,12 @@ # 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 sushy_tools.emulator.resources.drives.staticdriver import StaticDriver from oslotest import base from six.moves import mock +from sushy_tools.emulator.resources.drives.staticdriver import StaticDriver + class StaticDriverTestCase(base.BaseTestCase): SYSTEM_UUID = "da69abcc-dae0-4913-9a7b-d344043097c0" diff --git a/sushy_tools/tests/unit/emulator/resources/storage/test_static.py b/sushy_tools/tests/unit/emulator/resources/storage/test_static.py index 8fb76c16..e345b566 100644 --- a/sushy_tools/tests/unit/emulator/resources/storage/test_static.py +++ b/sushy_tools/tests/unit/emulator/resources/storage/test_static.py @@ -12,11 +12,12 @@ # 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 sushy_tools.emulator.resources.storage.staticdriver import StaticDriver from oslotest import base from six.moves import mock +from sushy_tools.emulator.resources.storage.staticdriver import StaticDriver + class StaticDriverTestCase(base.BaseTestCase): UUID = "da69abcc-dae0-4913-9a7b-d344043097c0" diff --git a/sushy_tools/tests/unit/emulator/resources/systems/test_libvirt.py b/sushy_tools/tests/unit/emulator/resources/systems/test_libvirt.py index 7fb3df66..a52cbd5b 100644 --- a/sushy_tools/tests/unit/emulator/resources/systems/test_libvirt.py +++ b/sushy_tools/tests/unit/emulator/resources/systems/test_libvirt.py @@ -12,11 +12,11 @@ import sys import uuid +import xml.etree.ElementTree as ET import libvirt from oslotest import base from six.moves import mock -import xml.etree.ElementTree as ET from sushy_tools.emulator.resources.systems.libvirtdriver import LibvirtDriver from sushy_tools import error diff --git a/test-requirements.txt b/test-requirements.txt index 1e294c6b..92df5f6f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -18,3 +18,5 @@ testscenarios>=0.4 # Apache-2.0/BSD testtools>=2.2.0 # MIT munch>=2.1.0 # MIT reno>=2.5.0 # Apache-2.0 +flake8-import-order>=0.17.1 # LGPLv3 + diff --git a/tox.ini b/tox.ini index 9d9089e4..a485bfd5 100644 --- a/tox.ini +++ b/tox.ini @@ -56,6 +56,9 @@ show-source = True ignore = E123,E125,W503 builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build +import-order-style = pep8 +application-import-names = sushy_tools +filename = *.py [testenv:lower-constraints] deps =