mypy: Cleanup "noqa: H301" comments

We decided that H301 makes no sense for the "typing"
module, just set that in tox.ini instead of every
time it is used.

Change-Id: Id983fb0a9feef2311bf4b2e6fd70386ab60e974a
This commit is contained in:
Eric Harney 2023-11-15 11:53:17 -05:00
parent 551c1f9ecd
commit 349b0a1ccd
26 changed files with 30 additions and 27 deletions

View File

@ -13,7 +13,7 @@
from __future__ import annotations from __future__ import annotations
import typing import typing
from typing import Any, Generator, Iterable, Optional, Union # noqa: H301 from typing import Any, Generator, Iterable, Optional, Union
from keystoneauth1 import exceptions as ks_exc from keystoneauth1 import exceptions as ks_exc
from keystoneauth1 import identity from keystoneauth1 import identity

View File

@ -20,7 +20,7 @@ import json
import os import os
import re import re
import typing import typing
from typing import Any, Iterable, Optional, Union # noqa: H301 from typing import Any, Iterable, Optional, Union
import urllib import urllib
from oslo_config import cfg from oslo_config import cfg

View File

@ -48,7 +48,7 @@ import os
import re import re
import subprocess import subprocess
import time import time
from typing import Dict, List, Optional, Tuple # noqa: H301 from typing import Dict, List, Optional, Tuple
import eventlet import eventlet
from os_brick.initiator import linuxrbd from os_brick.initiator import linuxrbd

View File

@ -63,7 +63,7 @@ import re
import sys import sys
import time import time
import typing import typing
from typing import Any, Callable, Optional, Tuple, Union # noqa: H301 from typing import Any, Callable, Optional, Tuple, Union
from oslo_config import cfg from oslo_config import cfg
from oslo_db import exception as db_exc from oslo_db import exception as db_exc

View File

@ -20,7 +20,7 @@
from __future__ import annotations from __future__ import annotations
import copy import copy
from typing import Any, Optional # noqa: H301 from typing import Any, Optional
from keystoneauth1.access import service_catalog as ksa_service_catalog from keystoneauth1.access import service_catalog as ksa_service_catalog
from keystoneauth1 import plugin from keystoneauth1 import plugin

View File

@ -21,7 +21,7 @@ import inspect
import os import os
import re import re
import sys import sys
from typing import Callable, Optional # noqa: H301 from typing import Callable, Optional
import uuid import uuid
import decorator import decorator

View File

@ -22,7 +22,7 @@ SHOULD include dedicated exception logging.
""" """
from typing import Optional, Union # noqa: H301 from typing import Optional, Union
from oslo_log import log as logging from oslo_log import log as logging
from oslo_versionedobjects import exception as obj_exc from oslo_versionedobjects import exception as obj_exc

View File

@ -13,7 +13,7 @@
from __future__ import annotations from __future__ import annotations
import os import os
from typing import Any, Optional # noqa: H301 from typing import Any, Optional
from oslo_log import log as logging from oslo_log import log as logging
# For more information please visit: https://wiki.openstack.org/wiki/TaskFlow # For more information please visit: https://wiki.openstack.org/wiki/TaskFlow

View File

@ -25,7 +25,7 @@ import shutil
import sys import sys
import textwrap import textwrap
import time import time
from typing import (Any, Callable, Iterable, NoReturn, Optional) # noqa: H301 from typing import (Any, Callable, Iterable, NoReturn, Optional)
import urllib import urllib
import urllib.parse import urllib.parse

View File

@ -32,7 +32,7 @@ import math
import os import os
import re import re
import tempfile import tempfile
from typing import ContextManager, Generator, Optional # noqa: H301 from typing import ContextManager, Generator, Optional
import cryptography import cryptography
from cursive import exception as cursive_exception from cursive import exception as cursive_exception

View File

@ -17,7 +17,7 @@
import sys import sys
import typing import typing
from typing import Optional, Type # noqa: H301 from typing import Optional, Type
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging

View File

@ -20,7 +20,7 @@ Pluggable Weighing support
from __future__ import annotations from __future__ import annotations
import abc import abc
from typing import Iterable, Optional # noqa: H301 from typing import Iterable, Optional
from oslo_log import log as logging from oslo_log import log as logging

View File

@ -22,7 +22,7 @@ Weighing Functions.
from __future__ import annotations from __future__ import annotations
from typing import (Optional, Union) # noqa: H301 from typing import (Optional, Union)
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging

View File

@ -12,7 +12,7 @@
from __future__ import annotations # Remove when only supporting python 3.9+ from __future__ import annotations # Remove when only supporting python 3.9+
from typing import Any, Optional # noqa: H301 from typing import Any, Optional
from oslo_log import log as logging from oslo_log import log as logging
from oslo_utils import excutils from oslo_utils import excutils

View File

@ -20,7 +20,7 @@ from __future__ import annotations
from collections import abc from collections import abc
import random import random
import typing import typing
from typing import (Any, Iterable, Optional, Type, Union) # noqa: H301 from typing import (Any, Iterable, Optional, Type, Union)
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging

View File

@ -44,8 +44,8 @@ import stat
import sys import sys
import tempfile import tempfile
import typing import typing
from typing import Callable, Iterable, Iterator # noqa: H301 from typing import Callable, Iterable, Iterator
from typing import Optional, Type, Union # noqa: H301 from typing import Optional, Type, Union
import eventlet import eventlet
from eventlet import tpool from eventlet import tpool

View File

@ -21,7 +21,7 @@ from __future__ import annotations
import ast import ast
import collections import collections
import datetime import datetime
from typing import (Any, DefaultDict, Iterable, Optional, Union) # noqa: H301 from typing import (Any, DefaultDict, Iterable, Optional, Union)
from castellan import key_manager from castellan import key_manager
from oslo_config import cfg from oslo_config import cfg

View File

@ -23,7 +23,7 @@ import math
import os import os
import tempfile import tempfile
import typing import typing
from typing import Any, Optional, Union # noqa: H301 from typing import Any, Optional, Union
import urllib.parse import urllib.parse
from castellan import key_manager from castellan import key_manager

View File

@ -27,7 +27,7 @@ import string
import tempfile import tempfile
import time import time
import typing import typing
from typing import Callable, List, Optional, Tuple, Union # noqa: H301 from typing import Callable, List, Optional, Tuple, Union
from castellan import key_manager from castellan import key_manager
from os_brick.remotefs import remotefs as remotefs_brick from os_brick.remotefs import remotefs as remotefs_brick

View File

@ -13,7 +13,7 @@
from __future__ import annotations # Remove when only supporting python 3.9+ from __future__ import annotations # Remove when only supporting python 3.9+
from typing import Any, Optional, Type, Union # noqa: H301 from typing import Any, Optional, Type, Union
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging

View File

@ -15,7 +15,7 @@ from __future__ import annotations
import binascii import binascii
import traceback import traceback
import typing import typing
from typing import Any, Optional # noqa: H301 from typing import Any, Optional
from castellan import key_manager from castellan import key_manager
import os_brick.initiator.connectors import os_brick.initiator.connectors

View File

@ -40,7 +40,7 @@ from __future__ import annotations # Remove when only supporting Python 3.9+
import functools import functools
import time import time
import typing import typing
from typing import Any, Optional, Union # noqa: H301 from typing import Any, Optional, Union
from castellan import key_manager from castellan import key_manager
from oslo_config import cfg from oslo_config import cfg

View File

@ -14,7 +14,7 @@
from __future__ import annotations from __future__ import annotations
from typing import Optional, Union # noqa: H301 from typing import Optional, Union
from cinder.common import constants from cinder.common import constants
from cinder import context from cinder import context

View File

@ -21,7 +21,7 @@
from __future__ import annotations from __future__ import annotations
from typing import Any, Iterable, Optional, Union # noqa: H301 from typing import Any, Iterable, Optional, Union
from oslo_config import cfg from oslo_config import cfg
from oslo_db import exception as db_exc from oslo_db import exception as db_exc

View File

@ -33,8 +33,8 @@ import tempfile
import time import time
import types import types
import typing import typing
from typing import Any, BinaryIO, Callable, IO # noqa: H301 from typing import Any, BinaryIO, Callable, IO
from typing import Optional, Union # noqa: H301 from typing import Optional, Union
import uuid import uuid
from castellan.common.credentials import keystone_password from castellan.common.credentials import keystone_password

View File

@ -285,3 +285,6 @@ deps = -r{toxinidir}/requirements.txt
ruff ruff
commands = commands =
ruff {toxinidir}/cinder {posargs} ruff {toxinidir}/cinder {posargs}
[hacking]
import_exceptions = typing