From 801497f5a4e208297818e40ee771ccb404fcd227 Mon Sep 17 00:00:00 2001 From: Eduardo Olivares Date: Wed, 26 Mar 2025 15:01:30 +0100 Subject: [PATCH] Remove unneeded "import typing" and "noqa" Some "import typing # noqa" lines were not needed because typing was not used on those modules. And some other imports had been tagged with # noqa and it was not needed either. Change-Id: I06e01f5ad25264f5e811a4ada2a1881303b0e88c --- setup.py | 2 +- tobiko/common/_exception.py | 2 +- tobiko/openstack/tests/_nova.py | 1 - tobiko/shell/curl/_execute.py | 2 +- tobiko/shell/find.py | 2 +- tobiko/shell/grep.py | 2 +- tobiko/shell/sh/_path.py | 1 - tobiko/shell/sh/_process.py | 2 +- tobiko/shell/sh/_reboot.py | 1 - tobiko/shell/sh/_ssh.py | 2 +- tobiko/shell/ss.py | 3 ++- tobiko/tripleo/nova.py | 2 +- tools/get_version.py | 2 +- tools/install.py | 4 ++-- tools/run_tests.py | 2 +- tools/setup_infrared.py | 2 +- 16 files changed, 15 insertions(+), 17 deletions(-) diff --git a/setup.py b/setup.py index 97fde2152..936d950ad 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import setuptools # setuptools if some other modules registered functions in `atexit`. # solution from: http://bugs.python.org/issue15881#msg170215 try: - import multiprocessing # noqa + import multiprocessing except ImportError: pass diff --git a/tobiko/common/_exception.py b/tobiko/common/_exception.py index f877efd34..66dc416ef 100644 --- a/tobiko/common/_exception.py +++ b/tobiko/common/_exception.py @@ -16,7 +16,7 @@ from __future__ import absolute_import import contextlib import collections import sys -import typing # noqa +import typing from oslo_log import log import testtools diff --git a/tobiko/openstack/tests/_nova.py b/tobiko/openstack/tests/_nova.py index ccc6e2192..3bd19a014 100644 --- a/tobiko/openstack/tests/_nova.py +++ b/tobiko/openstack/tests/_nova.py @@ -16,7 +16,6 @@ from __future__ import absolute_import import os -import typing # noqa import tobiko from tobiko.shell import ping diff --git a/tobiko/shell/curl/_execute.py b/tobiko/shell/curl/_execute.py index 740b909dc..580b00ce5 100644 --- a/tobiko/shell/curl/_execute.py +++ b/tobiko/shell/curl/_execute.py @@ -15,7 +15,7 @@ # under the License. from __future__ import absolute_import -import typing # noqa +import typing from urllib import parse import netaddr diff --git a/tobiko/shell/find.py b/tobiko/shell/find.py index 64bc4c59b..3f1f447f5 100644 --- a/tobiko/shell/find.py +++ b/tobiko/shell/find.py @@ -16,7 +16,7 @@ from __future__ import absolute_import import math -import typing # noqa +import typing import tobiko from tobiko.shell import sh diff --git a/tobiko/shell/grep.py b/tobiko/shell/grep.py index 30f26ba85..a6e05323c 100644 --- a/tobiko/shell/grep.py +++ b/tobiko/shell/grep.py @@ -15,7 +15,7 @@ # under the License. from __future__ import absolute_import -import typing # noqa +import typing import tobiko from tobiko.shell import sh diff --git a/tobiko/shell/sh/_path.py b/tobiko/shell/sh/_path.py index 49f707410..c19947569 100644 --- a/tobiko/shell/sh/_path.py +++ b/tobiko/shell/sh/_path.py @@ -15,7 +15,6 @@ # under the License. from __future__ import absolute_import -import typing # noqa from os.path import expanduser from oslo_log import log diff --git a/tobiko/shell/sh/_process.py b/tobiko/shell/sh/_process.py index f56a8e634..24ee5340e 100644 --- a/tobiko/shell/sh/_process.py +++ b/tobiko/shell/sh/_process.py @@ -18,7 +18,7 @@ from __future__ import absolute_import import io import os import time -import typing # noqa +import typing from multiprocessing import Process as MultiProcess import psutil diff --git a/tobiko/shell/sh/_reboot.py b/tobiko/shell/sh/_reboot.py index 65db439af..8c5890a29 100644 --- a/tobiko/shell/sh/_reboot.py +++ b/tobiko/shell/sh/_reboot.py @@ -14,7 +14,6 @@ from __future__ import absolute_import import enum -import typing # noqa from oslo_log import log diff --git a/tobiko/shell/sh/_ssh.py b/tobiko/shell/sh/_ssh.py index dc67fae73..e491bc9ed 100644 --- a/tobiko/shell/sh/_ssh.py +++ b/tobiko/shell/sh/_ssh.py @@ -28,7 +28,7 @@ from tobiko.shell.sh import _io from tobiko.shell.sh import _local from tobiko.shell.sh import _process from tobiko.shell import ssh -import typing # noqa + LOG = log.getLogger(__name__) diff --git a/tobiko/shell/ss.py b/tobiko/shell/ss.py index 07b3ed1dd..5ac95e33f 100644 --- a/tobiko/shell/ss.py +++ b/tobiko/shell/ss.py @@ -15,9 +15,10 @@ # under the License. from __future__ import absolute_import +import typing + import netaddr from oslo_log import log -import typing # noqa import tobiko from tobiko.shell import sh diff --git a/tobiko/tripleo/nova.py b/tobiko/tripleo/nova.py index ee49ec2fb..97de13d4f 100644 --- a/tobiko/tripleo/nova.py +++ b/tobiko/tripleo/nova.py @@ -15,7 +15,7 @@ # under the License. from __future__ import absolute_import -import typing # noqa +import typing from functools import wraps import netaddr diff --git a/tools/get_version.py b/tools/get_version.py index 29faa47a7..dbeba711e 100755 --- a/tools/get_version.py +++ b/tools/get_version.py @@ -22,7 +22,7 @@ TOP_DIR = os.path.realpath(os.path.dirname(os.path.dirname(__file__))) if TOP_DIR not in sys.path: sys.path.insert(0, TOP_DIR) -from tools import common # noqa +from tools import common def main(): diff --git a/tools/install.py b/tools/install.py index 2a3d7688f..ac943a36c 100755 --- a/tools/install.py +++ b/tools/install.py @@ -24,8 +24,8 @@ TOP_DIR = os.path.realpath(os.path.dirname(os.path.dirname(__file__))) if TOP_DIR not in sys.path: sys.path.insert(0, TOP_DIR) -from tools import common # noqa -from tools import get_version # noqa +from tools import common +from tools import get_version LOG = common.get_logger(__name__) diff --git a/tools/run_tests.py b/tools/run_tests.py index 8e6f0cab7..c841ef9cb 100755 --- a/tools/run_tests.py +++ b/tools/run_tests.py @@ -26,7 +26,7 @@ TOP_DIR = os.path.dirname(os.path.dirname(__file__)) if TOP_DIR not in sys.path: sys.path.insert(0, TOP_DIR) -from tools import common # noqa +from tools import common LOG = common.get_logger(__name__) diff --git a/tools/setup_infrared.py b/tools/setup_infrared.py index 410673e96..6a947fa14 100644 --- a/tools/setup_infrared.py +++ b/tools/setup_infrared.py @@ -21,7 +21,7 @@ TOP_DIR = os.path.dirname(os.path.dirname(__file__)) if TOP_DIR not in sys.path: sys.path.insert(0, TOP_DIR) -from tools import common # noqa +from tools import common LOG = common.get_logger(__name__)