diff options
| author | Federico Caselli <cfederico87@gmail.com> | 2022-04-11 22:21:20 +0200 |
|---|---|---|
| committer | Federico Caselli <cfederico87@gmail.com> | 2022-04-11 22:48:23 +0200 |
| commit | 11bf82447438a9d5d9df9d613bf245694d6120dc (patch) | |
| tree | 727dd81d7dbf9811b15639aabb4ee69ce4ee5646 /lib/sqlalchemy/util | |
| parent | fd052732604a0d03167978215f0077e60b75851d (diff) | |
| download | sqlalchemy-11bf82447438a9d5d9df9d613bf245694d6120dc.tar.gz | |
update flake8 noqa skips with proper syntax
Change-Id: I42ed77f559e3ee5b8c600d98457ee37803ef0ea6
Diffstat (limited to 'lib/sqlalchemy/util')
| -rw-r--r-- | lib/sqlalchemy/util/_collections.py | 6 | ||||
| -rw-r--r-- | lib/sqlalchemy/util/_concurrency_py3k.py | 2 | ||||
| -rw-r--r-- | lib/sqlalchemy/util/_py_collections.py | 2 | ||||
| -rw-r--r-- | lib/sqlalchemy/util/concurrency.py | 20 | ||||
| -rw-r--r-- | lib/sqlalchemy/util/langhelpers.py | 6 | ||||
| -rw-r--r-- | lib/sqlalchemy/util/typing.py | 12 |
6 files changed, 24 insertions, 24 deletions
diff --git a/lib/sqlalchemy/util/_collections.py b/lib/sqlalchemy/util/_collections.py index bcb2ad423..eb5b16b65 100644 --- a/lib/sqlalchemy/util/_collections.py +++ b/lib/sqlalchemy/util/_collections.py @@ -388,11 +388,11 @@ class UniqueAppender(Generic[_T]): self.data = data self._unique = {} if via: - self._data_appender = getattr(data, via) # type: ignore[assignment] # noqa E501 + self._data_appender = getattr(data, via) # type: ignore[assignment] # noqa: E501 elif hasattr(data, "append"): - self._data_appender = cast("List[_T]", data).append # type: ignore[assignment] # noqa E501 + self._data_appender = cast("List[_T]", data).append # type: ignore[assignment] # noqa: E501 elif hasattr(data, "add"): - self._data_appender = cast("Set[_T]", data).add # type: ignore[assignment] # noqa E501 + self._data_appender = cast("Set[_T]", data).add # type: ignore[assignment] # noqa: E501 def append(self, item: _T) -> None: id_ = id(item) diff --git a/lib/sqlalchemy/util/_concurrency_py3k.py b/lib/sqlalchemy/util/_concurrency_py3k.py index b17b408dd..28b062d3d 100644 --- a/lib/sqlalchemy/util/_concurrency_py3k.py +++ b/lib/sqlalchemy/util/_concurrency_py3k.py @@ -122,7 +122,7 @@ def await_fallback(awaitable: Awaitable[_T]) -> _T: "loop is already running; can't call await_() here. " "Was IO attempted in an unexpected place?" ) - return loop.run_until_complete(awaitable) # type: ignore[no-any-return] # noqa E501 + return loop.run_until_complete(awaitable) # type: ignore[no-any-return] # noqa: E501 return current.driver.switch(awaitable) # type: ignore[no-any-return] diff --git a/lib/sqlalchemy/util/_py_collections.py b/lib/sqlalchemy/util/_py_collections.py index 1016871aa..d649a0bea 100644 --- a/lib/sqlalchemy/util/_py_collections.py +++ b/lib/sqlalchemy/util/_py_collections.py @@ -195,7 +195,7 @@ class OrderedSet(Set[_T]): return self # type: ignore def union(self, *other: Iterable[_S]) -> "OrderedSet[Union[_T, _S]]": - result: "OrderedSet[Union[_T, _S]]" = self.__class__(self) # type: ignore # noqa E501 + result: "OrderedSet[Union[_T, _S]]" = self.__class__(self) # type: ignore # noqa: E501 for o in other: result.update(o) return result diff --git a/lib/sqlalchemy/util/concurrency.py b/lib/sqlalchemy/util/concurrency.py index 778d1275b..c1d53cc16 100644 --- a/lib/sqlalchemy/util/concurrency.py +++ b/lib/sqlalchemy/util/concurrency.py @@ -12,7 +12,7 @@ import typing have_greenlet = False greenlet_error = None try: - import greenlet # type: ignore # noqa F401 + import greenlet # type: ignore # noqa: F401 except ImportError as e: greenlet_error = str(e) pass @@ -25,9 +25,9 @@ else: from ._concurrency_py3k import AsyncAdaptedLock as AsyncAdaptedLock from ._concurrency_py3k import ( _util_async_run as _util_async_run, - ) # noqa F401 + ) # noqa: F401 from ._concurrency_py3k import ( - _util_async_run_coroutine_function as _util_async_run_coroutine_function, # noqa F401, E501 + _util_async_run_coroutine_function as _util_async_run_coroutine_function, # noqa: F401, E501 ) if not typing.TYPE_CHECKING and not have_greenlet: @@ -45,23 +45,23 @@ if not typing.TYPE_CHECKING and not have_greenlet: else "" ) - def is_exit_exception(e): # noqa F811 + def is_exit_exception(e): return not isinstance(e, Exception) - def await_only(thing): # type: ignore # noqa F811 + def await_only(thing): # type: ignore _not_implemented() - def await_fallback(thing): # type: ignore # noqa F81 + def await_fallback(thing): # type: ignore return thing - def greenlet_spawn(fn, *args, **kw): # type: ignore # noqa F81 + def greenlet_spawn(fn, *args, **kw): # type: ignore _not_implemented() - def AsyncAdaptedLock(*args, **kw): # type: ignore # noqa F81 + def AsyncAdaptedLock(*args, **kw): # type: ignore _not_implemented() - def _util_async_run(fn, *arg, **kw): # type: ignore # noqa F81 + def _util_async_run(fn, *arg, **kw): # type: ignore return fn(*arg, **kw) - def _util_async_run_coroutine_function(fn, *arg, **kw): # type: ignore # noqa F81 + def _util_async_run_coroutine_function(fn, *arg, **kw): # type: ignore _not_implemented() diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py index 00097fd9e..8f0ec700f 100644 --- a/lib/sqlalchemy/util/langhelpers.py +++ b/lib/sqlalchemy/util/langhelpers.py @@ -510,7 +510,7 @@ def get_callable_argspec( fn.__init__, no_self=no_self, _is_init=True ) elif hasattr(fn, "__func__"): - return compat.inspect_getfullargspec(fn.__func__) # type: ignore[attr-defined] # noqa E501 + return compat.inspect_getfullargspec(fn.__func__) # type: ignore[attr-defined] # noqa: E501 elif hasattr(fn, "__call__"): if inspect.ismethod(fn.__call__): # type: ignore [operator] return get_callable_argspec( @@ -711,7 +711,7 @@ def create_proxy_methods( else: code = ( "def %(name)s%(grouped_args)s:\n" - " return %(self_arg)s._proxied.%(name)s(%(apply_kw_proxied)s)" # noqa E501 + " return %(self_arg)s._proxied.%(name)s(%(apply_kw_proxied)s)" # noqa: E501 % metadata ) @@ -1544,7 +1544,7 @@ def assert_arg_type( if isinstance(argtype, tuple): raise exc.ArgumentError( "Argument '%s' is expected to be one of type %s, got '%s'" - % (name, " or ".join("'%s'" % a for a in argtype), type(arg)) # type: ignore # noqa E501 + % (name, " or ".join("'%s'" % a for a in argtype), type(arg)) # type: ignore # noqa: E501 ) else: raise exc.ArgumentError( diff --git a/lib/sqlalchemy/util/typing.py b/lib/sqlalchemy/util/typing.py index 0b9d8c62c..df54017da 100644 --- a/lib/sqlalchemy/util/typing.py +++ b/lib/sqlalchemy/util/typing.py @@ -47,16 +47,16 @@ else: if typing.TYPE_CHECKING or compat.py310: from typing import Annotated as Annotated else: - from typing_extensions import Annotated as Annotated # noqa F401 + from typing_extensions import Annotated as Annotated # noqa: F401 if typing.TYPE_CHECKING or compat.py38: from typing import Literal as Literal from typing import Protocol as Protocol from typing import TypedDict as TypedDict else: - from typing_extensions import Literal as Literal # noqa F401 - from typing_extensions import Protocol as Protocol # noqa F401 - from typing_extensions import TypedDict as TypedDict # noqa F401 + from typing_extensions import Literal as Literal # noqa: F401 + from typing_extensions import Protocol as Protocol # noqa: F401 + from typing_extensions import TypedDict as TypedDict # noqa: F401 # copied from TypeShed, required in order to implement # MutableMapping.update() @@ -77,8 +77,8 @@ if typing.TYPE_CHECKING or not compat.py310: from typing_extensions import Concatenate as Concatenate from typing_extensions import ParamSpec as ParamSpec else: - from typing import Concatenate as Concatenate # noqa F401 - from typing import ParamSpec as ParamSpec # noqa F401 + from typing import Concatenate as Concatenate # noqa: F401 + from typing import ParamSpec as ParamSpec # noqa: F401 def de_stringify_annotation( |
