From edc5dd4e7c73a37b951993e9a449645bddb80af3 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 24 Jun 2025 00:09:43 +0900 Subject: [PATCH] Restore flake8-import-order It was removed when pre-commit was introduced[1]. The version is capped by the current latest minor version to avoid pulling new checks. [1] d40564de3ec8c588777d035236cfc7f626a86840 Change-Id: Id50192d80bc7e879d2f599fd515a39903c834842 Signed-off-by: Takashi Kajinami --- .pre-commit-config.yaml | 3 ++- sushy/oem/dell/asynchronous.py | 1 + .../oem/dell/resources/manager/idrac_card_service.py | 3 +-- sushy/oem/dell/resources/manager/job_collection.py | 3 +-- sushy/oem/dell/resources/manager/manager.py | 11 +++++------ sushy/oem/dell/resources/system/raid_service.py | 3 +-- sushy/oem/dell/resources/system/storage/controller.py | 3 +-- sushy/oem/dell/resources/system/system.py | 5 ++--- sushy/oem/dell/resources/taskservice/task.py | 3 +-- sushy/tests/oem/dell/functional/vmedia_boot.py | 1 - .../oem/dell/unit/resources/manager/test_manager.py | 6 +++--- .../unit/resources/system/storage/test_controller.py | 4 ++-- .../dell/unit/resources/system/test_raid_service.py | 4 ++-- .../oem/dell/unit/resources/system/test_system.py | 2 +- .../oem/dell/unit/resources/taskservice/test_task.py | 2 +- sushy/tests/oem/dell/unit/test_asynchronous.py | 2 +- sushy/tests/oem/dell/unit/test_root.py | 1 + 17 files changed, 26 insertions(+), 31 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d176ec92..4fed5c86 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,8 @@ repos: rev: 6.1.0 hooks: - id: hacking - additional_dependencies: [] + additional_dependencies: + - flake8-import-order>=0.19,<0.20 exclude: '^(doc|releasenotes|tools)/.*$' - repo: https://github.com/codespell-project/codespell rev: v2.2.6 diff --git a/sushy/oem/dell/asynchronous.py b/sushy/oem/dell/asynchronous.py index ca1ba7db..7a30ea34 100644 --- a/sushy/oem/dell/asynchronous.py +++ b/sushy/oem/dell/asynchronous.py @@ -16,6 +16,7 @@ import logging import time from dateutil import parser + import sushy LOG = logging.getLogger(__name__) diff --git a/sushy/oem/dell/resources/manager/idrac_card_service.py b/sushy/oem/dell/resources/manager/idrac_card_service.py index 0e2388e7..9f3fdcbc 100644 --- a/sushy/oem/dell/resources/manager/idrac_card_service.py +++ b/sushy/oem/dell/resources/manager/idrac_card_service.py @@ -16,11 +16,10 @@ import logging import secrets from sushy import exceptions +from sushy.oem.dell.resources.manager import constants as mgr_cons from sushy.resources import base from sushy.resources import common -from sushy.oem.dell.resources.manager import constants as mgr_cons - LOG = logging.getLogger(__name__) diff --git a/sushy/oem/dell/resources/manager/job_collection.py b/sushy/oem/dell/resources/manager/job_collection.py index 85a7e657..13447b73 100644 --- a/sushy/oem/dell/resources/manager/job_collection.py +++ b/sushy/oem/dell/resources/manager/job_collection.py @@ -14,9 +14,8 @@ import logging -from sushy.resources import base - from sushy.oem.dell import constants +from sushy.resources import base LOG = logging.getLogger(__name__) diff --git a/sushy/oem/dell/resources/manager/manager.py b/sushy/oem/dell/resources/manager/manager.py index dd34ca1b..b0419bd8 100644 --- a/sushy/oem/dell/resources/manager/manager.py +++ b/sushy/oem/dell/resources/manager/manager.py @@ -19,12 +19,6 @@ import time from urllib.parse import urlparse import sushy -from sushy.resources import base -from sushy.resources import common -from sushy.resources.oem import base as oem_base -from sushy.taskmonitor import TaskMonitor -from sushy import utils as sushy_utils - from sushy.oem.dell import asynchronous from sushy.oem.dell import constants from sushy.oem.dell.resources import attributes @@ -34,6 +28,11 @@ from sushy.oem.dell.resources.manager import job_collection from sushy.oem.dell.resources.manager import job_service from sushy.oem.dell.resources.manager import lifecycle_service from sushy.oem.dell import utils +from sushy.resources import base +from sushy.resources import common +from sushy.resources.oem import base as oem_base +from sushy.taskmonitor import TaskMonitor +from sushy import utils as sushy_utils LOG = logging.getLogger(__name__) diff --git a/sushy/oem/dell/resources/system/raid_service.py b/sushy/oem/dell/resources/system/raid_service.py index 8c332647..20b5c88d 100644 --- a/sushy/oem/dell/resources/system/raid_service.py +++ b/sushy/oem/dell/resources/system/raid_service.py @@ -15,12 +15,11 @@ import logging from sushy import exceptions +from sushy.oem.dell import constants from sushy.resources import base from sushy.resources import common from sushy import taskmonitor -from sushy.oem.dell import constants - LOG = logging.getLogger(__name__) diff --git a/sushy/oem/dell/resources/system/storage/controller.py b/sushy/oem/dell/resources/system/storage/controller.py index 28402abf..07362282 100644 --- a/sushy/oem/dell/resources/system/storage/controller.py +++ b/sushy/oem/dell/resources/system/storage/controller.py @@ -13,11 +13,10 @@ # under the License. import sushy +from sushy.oem.dell.resources.system.storage import constants as s_cons from sushy.resources import base from sushy.resources.oem import base as oem_base -from sushy.oem.dell.resources.system.storage import constants as s_cons - class DellStorageController(base.CompositeField): diff --git a/sushy/oem/dell/resources/system/system.py b/sushy/oem/dell/resources/system/system.py index d337280f..7c596261 100644 --- a/sushy/oem/dell/resources/system/system.py +++ b/sushy/oem/dell/resources/system/system.py @@ -14,11 +14,10 @@ import sushy from sushy import exceptions -from sushy.resources.oem import base as oem_base -from sushy import utils as sushy_utils - from sushy.oem.dell.resources.system import constants as sys_cons from sushy.oem.dell.resources.system import raid_service +from sushy.resources.oem import base as oem_base +from sushy import utils as sushy_utils def _filter_disks_not_in_mode(controller_to_disks, mode): diff --git a/sushy/oem/dell/resources/taskservice/task.py b/sushy/oem/dell/resources/taskservice/task.py index be07b21c..ffc42e7b 100644 --- a/sushy/oem/dell/resources/taskservice/task.py +++ b/sushy/oem/dell/resources/taskservice/task.py @@ -14,11 +14,10 @@ import logging +from sushy.oem.dell.resources.taskservice import constants as ts_cons from sushy.resources import base from sushy.resources.oem import base as oem_base -from sushy.oem.dell.resources.taskservice import constants as ts_cons - LOG = logging.getLogger(__name__) diff --git a/sushy/tests/oem/dell/functional/vmedia_boot.py b/sushy/tests/oem/dell/functional/vmedia_boot.py index 4c95d6d8..0d659e0b 100644 --- a/sushy/tests/oem/dell/functional/vmedia_boot.py +++ b/sushy/tests/oem/dell/functional/vmedia_boot.py @@ -14,7 +14,6 @@ import os import sys import sushy - from sushy.oem.dell import utils USERNAME = 'root' diff --git a/sushy/tests/oem/dell/unit/resources/manager/test_manager.py b/sushy/tests/oem/dell/unit/resources/manager/test_manager.py index 1e980938..56957349 100644 --- a/sushy/tests/oem/dell/unit/resources/manager/test_manager.py +++ b/sushy/tests/oem/dell/unit/resources/manager/test_manager.py @@ -20,16 +20,16 @@ from unittest import mock from oslotest.base import BaseTestCase import requests -import sushy -from sushy.resources.manager import manager -from sushy.taskmonitor import TaskMonitor +import sushy from sushy.oem.dell.resources.manager import constants as mgr_cons from sushy.oem.dell.resources.manager import idrac_card_service as idrac_card from sushy.oem.dell.resources.manager import job_collection as jc from sushy.oem.dell.resources.manager import job_service as job from sushy.oem.dell.resources.manager import lifecycle_service as lifecycle from sushy.oem.dell.resources.manager import manager as oem_manager +from sushy.resources.manager import manager +from sushy.taskmonitor import TaskMonitor class ManagerTestCase(BaseTestCase): diff --git a/sushy/tests/oem/dell/unit/resources/system/storage/test_controller.py b/sushy/tests/oem/dell/unit/resources/system/storage/test_controller.py index ede19fbe..c5e4dd08 100644 --- a/sushy/tests/oem/dell/unit/resources/system/storage/test_controller.py +++ b/sushy/tests/oem/dell/unit/resources/system/storage/test_controller.py @@ -16,11 +16,11 @@ import json from unittest import mock from oslotest.base import BaseTestCase -import sushy -from sushy.resources.system.storage import controller as sushy_constroller +import sushy from sushy.oem.dell.resources.system.storage import constants as ctrl_cons from sushy.oem.dell.resources.system.storage import controller as oem_ctrl +from sushy.resources.system.storage import controller as sushy_constroller class ControllerTestCase(BaseTestCase): diff --git a/sushy/tests/oem/dell/unit/resources/system/test_raid_service.py b/sushy/tests/oem/dell/unit/resources/system/test_raid_service.py index c474282b..c17d4d68 100644 --- a/sushy/tests/oem/dell/unit/resources/system/test_raid_service.py +++ b/sushy/tests/oem/dell/unit/resources/system/test_raid_service.py @@ -16,10 +16,10 @@ import json from unittest import mock from oslotest.base import BaseTestCase -from sushy import exceptions -from sushy import taskmonitor +from sushy import exceptions from sushy.oem.dell.resources.system import raid_service +from sushy import taskmonitor class DellRaidService(BaseTestCase): diff --git a/sushy/tests/oem/dell/unit/resources/system/test_system.py b/sushy/tests/oem/dell/unit/resources/system/test_system.py index c5d16bf1..05d0b152 100644 --- a/sushy/tests/oem/dell/unit/resources/system/test_system.py +++ b/sushy/tests/oem/dell/unit/resources/system/test_system.py @@ -16,8 +16,8 @@ import json from unittest import mock from oslotest.base import BaseTestCase -from sushy import exceptions +from sushy import exceptions from sushy.oem.dell.resources.system import constants as sys_cons from sushy.oem.dell.resources.system import raid_service from sushy.oem.dell.resources.system import system as oem_system diff --git a/sushy/tests/oem/dell/unit/resources/taskservice/test_task.py b/sushy/tests/oem/dell/unit/resources/taskservice/test_task.py index 758333b5..95c25dea 100644 --- a/sushy/tests/oem/dell/unit/resources/taskservice/test_task.py +++ b/sushy/tests/oem/dell/unit/resources/taskservice/test_task.py @@ -16,10 +16,10 @@ import json from unittest import mock from oslotest.base import BaseTestCase -from sushy.resources.taskservice import task as sushy_task from sushy.oem.dell.resources.taskservice import constants as ts_cons from sushy.oem.dell.resources.taskservice import task +from sushy.resources.taskservice import task as sushy_task class TaskTestCase(BaseTestCase): diff --git a/sushy/tests/oem/dell/unit/test_asynchronous.py b/sushy/tests/oem/dell/unit/test_asynchronous.py index 2740c12d..8da5b3aa 100644 --- a/sushy/tests/oem/dell/unit/test_asynchronous.py +++ b/sushy/tests/oem/dell/unit/test_asynchronous.py @@ -17,8 +17,8 @@ from unittest import mock from oslotest.base import BaseTestCase -import sushy +import sushy from sushy.oem.dell.asynchronous import http_call diff --git a/sushy/tests/oem/dell/unit/test_root.py b/sushy/tests/oem/dell/unit/test_root.py index 49318bc2..ca267db7 100644 --- a/sushy/tests/oem/dell/unit/test_root.py +++ b/sushy/tests/oem/dell/unit/test_root.py @@ -17,6 +17,7 @@ import json from unittest import mock from oslotest.base import BaseTestCase + from sushy import main