diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f8341094..3fb93bdd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,10 +21,18 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install basic dependencies run: | python -m pip install --upgrade pip pip install wheel + pip install -e .[dev] + - name: Mypy strict without optional dependencies + run: | + mypy --strict tests/main/clients/*/expected_client + mypy --strict tests/main/graphql_schemas/*/expected_schema.py + mypy --strict ariadne_codegen/client_generators/dependencies + - name: Install optional dependencies + run: | pip install -e .[subscriptions,opentelemetry,dev] - name: Pytest run: | @@ -33,9 +41,10 @@ jobs: run: | pylint ariadne_codegen tests mypy ariadne_codegen --ignore-missing-imports - # these test outputs represent things that may be committed into other projects that may - # have strict mypy settings, and so they should be maximally annotated. - mypy --strict tests/main/clients/*/expected_client - mypy --strict tests/main/graphql_schemas/*/expected_schema.py black --check . isort . --check-only + - name: Mypy strict with all dependencies + run: | + mypy --strict tests/main/clients/*/expected_client + mypy --strict tests/main/graphql_schemas/*/expected_schema.py + mypy --strict ariadne_codegen/client_generators/dependencies diff --git a/CHANGELOG.md b/CHANGELOG.md index c35f6604..1e45f05f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Added `include_all_inputs` config flag to generate only inputs used in supplied operations. - Added `include_all_enums` config flag to generate only enums used in supplied operations. - Added `operationName` to payload sent by generated client's methods. +- Fixed base clients to pass `mypy --strict` without installed optional dependencies. ## 0.10.0 (2023-11-15) diff --git a/ariadne_codegen/client_generators/dependencies/async_base_client.py b/ariadne_codegen/client_generators/dependencies/async_base_client.py index fd727d35..d49c347c 100644 --- a/ariadne_codegen/client_generators/dependencies/async_base_client.py +++ b/ariadne_codegen/client_generators/dependencies/async_base_client.py @@ -16,8 +16,15 @@ ) try: - from websockets.client import WebSocketClientProtocol, connect as ws_connect - from websockets.typing import Data, Origin, Subprotocol + from websockets.client import ( # type: ignore[import-not-found,unused-ignore] + WebSocketClientProtocol, + connect as ws_connect, + ) + from websockets.typing import ( # type: ignore[import-not-found,unused-ignore] + Data, + Origin, + Subprotocol, + ) except ImportError: from contextlib import asynccontextmanager @@ -26,9 +33,9 @@ async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument raise NotImplementedError("Subscriptions require 'websockets' package.") yield # pylint: disable=unreachable - WebSocketClientProtocol = Any # type: ignore - Data = Any # type: ignore - Origin = Any # type: ignore + WebSocketClientProtocol = Any # type: ignore[misc,assignment,unused-ignore] + Data = Any # type: ignore[misc,assignment,unused-ignore] + Origin = Any # type: ignore[misc,assignment,unused-ignore] def Subprotocol(*args, **kwargs): # type: ignore # pylint: disable=invalid-name raise NotImplementedError("Subscriptions require 'websockets' package.") diff --git a/ariadne_codegen/client_generators/dependencies/async_base_client_open_telemetry.py b/ariadne_codegen/client_generators/dependencies/async_base_client_open_telemetry.py index 783c3e80..aee7a269 100644 --- a/ariadne_codegen/client_generators/dependencies/async_base_client_open_telemetry.py +++ b/ariadne_codegen/client_generators/dependencies/async_base_client_open_telemetry.py @@ -27,8 +27,15 @@ ) try: - from websockets.client import WebSocketClientProtocol, connect as ws_connect - from websockets.typing import Data, Origin, Subprotocol + from websockets.client import ( # type: ignore[import-not-found,unused-ignore] + WebSocketClientProtocol, + connect as ws_connect, + ) + from websockets.typing import ( # type: ignore[import-not-found,unused-ignore] + Data, + Origin, + Subprotocol, + ) except ImportError: from contextlib import asynccontextmanager @@ -37,26 +44,28 @@ async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument raise NotImplementedError("Subscriptions require 'websockets' package.") yield # pylint: disable=unreachable - WebSocketClientProtocol = Any # type: ignore - Data = Any # type: ignore - Origin = Any # type: ignore + WebSocketClientProtocol = Any # type: ignore[misc,assignment,unused-ignore] + Data = Any # type: ignore[misc,assignment,unused-ignore] + Origin = Any # type: ignore[misc,assignment,unused-ignore] def Subprotocol(*args, **kwargs): # type: ignore # pylint: disable=invalid-name raise NotImplementedError("Subscriptions require 'websockets' package.") try: - from opentelemetry.trace import ( # type: ignore[attr-defined] + from opentelemetry.context import ( # type: ignore[import-not-found,unused-ignore] Context, + ) + from opentelemetry.trace import ( # type: ignore[import-not-found,unused-ignore] Span, Tracer, get_tracer, set_span_in_context, ) except ImportError: - Context = Any # type: ignore - Span = Any # type: ignore - Tracer = Any # type: ignore + Context = Any # type: ignore[misc,assignment,unused-ignore] + Span = Any # type: ignore[misc,assignment,unused-ignore] + Tracer = Any # type: ignore[misc,assignment,unused-ignore] def get_tracer(*args, **kwargs) -> Tracer: # type: ignore raise NotImplementedError("Telemetry requires 'opentelemetry-api' package.") diff --git a/ariadne_codegen/client_generators/dependencies/base_client_open_telemetry.py b/ariadne_codegen/client_generators/dependencies/base_client_open_telemetry.py index c044ccb6..5a6a7f9e 100644 --- a/ariadne_codegen/client_generators/dependencies/base_client_open_telemetry.py +++ b/ariadne_codegen/client_generators/dependencies/base_client_open_telemetry.py @@ -13,17 +13,19 @@ ) try: - from opentelemetry.trace import ( # type: ignore[attr-defined] + from opentelemetry.context import ( # type: ignore[import-not-found,unused-ignore] Context, + ) + from opentelemetry.trace import ( # type: ignore[import-not-found,unused-ignore] Span, Tracer, get_tracer, set_span_in_context, ) except ImportError: - Context = Any # type: ignore - Span = Any # type: ignore - Tracer = Any # type: ignore + Context = Any # type: ignore[misc,assignment,unused-ignore] + Span = Any # type: ignore[misc,assignment,unused-ignore] + Tracer = Any # type: ignore[misc,assignment,unused-ignore] def get_tracer(*args, **kwargs) -> Tracer: # type: ignore raise NotImplementedError("Telemetry requires 'opentelemetry-api' package.") diff --git a/tests/main/clients/custom_config_file/expected_client/async_base_client.py b/tests/main/clients/custom_config_file/expected_client/async_base_client.py index fd727d35..d49c347c 100644 --- a/tests/main/clients/custom_config_file/expected_client/async_base_client.py +++ b/tests/main/clients/custom_config_file/expected_client/async_base_client.py @@ -16,8 +16,15 @@ ) try: - from websockets.client import WebSocketClientProtocol, connect as ws_connect - from websockets.typing import Data, Origin, Subprotocol + from websockets.client import ( # type: ignore[import-not-found,unused-ignore] + WebSocketClientProtocol, + connect as ws_connect, + ) + from websockets.typing import ( # type: ignore[import-not-found,unused-ignore] + Data, + Origin, + Subprotocol, + ) except ImportError: from contextlib import asynccontextmanager @@ -26,9 +33,9 @@ async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument raise NotImplementedError("Subscriptions require 'websockets' package.") yield # pylint: disable=unreachable - WebSocketClientProtocol = Any # type: ignore - Data = Any # type: ignore - Origin = Any # type: ignore + WebSocketClientProtocol = Any # type: ignore[misc,assignment,unused-ignore] + Data = Any # type: ignore[misc,assignment,unused-ignore] + Origin = Any # type: ignore[misc,assignment,unused-ignore] def Subprotocol(*args, **kwargs): # type: ignore # pylint: disable=invalid-name raise NotImplementedError("Subscriptions require 'websockets' package.") diff --git a/tests/main/clients/custom_files_names/expected_client/async_base_client.py b/tests/main/clients/custom_files_names/expected_client/async_base_client.py index fd727d35..d49c347c 100644 --- a/tests/main/clients/custom_files_names/expected_client/async_base_client.py +++ b/tests/main/clients/custom_files_names/expected_client/async_base_client.py @@ -16,8 +16,15 @@ ) try: - from websockets.client import WebSocketClientProtocol, connect as ws_connect - from websockets.typing import Data, Origin, Subprotocol + from websockets.client import ( # type: ignore[import-not-found,unused-ignore] + WebSocketClientProtocol, + connect as ws_connect, + ) + from websockets.typing import ( # type: ignore[import-not-found,unused-ignore] + Data, + Origin, + Subprotocol, + ) except ImportError: from contextlib import asynccontextmanager @@ -26,9 +33,9 @@ async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument raise NotImplementedError("Subscriptions require 'websockets' package.") yield # pylint: disable=unreachable - WebSocketClientProtocol = Any # type: ignore - Data = Any # type: ignore - Origin = Any # type: ignore + WebSocketClientProtocol = Any # type: ignore[misc,assignment,unused-ignore] + Data = Any # type: ignore[misc,assignment,unused-ignore] + Origin = Any # type: ignore[misc,assignment,unused-ignore] def Subprotocol(*args, **kwargs): # type: ignore # pylint: disable=invalid-name raise NotImplementedError("Subscriptions require 'websockets' package.") diff --git a/tests/main/clients/custom_scalars/expected_client/async_base_client.py b/tests/main/clients/custom_scalars/expected_client/async_base_client.py index fd727d35..d49c347c 100644 --- a/tests/main/clients/custom_scalars/expected_client/async_base_client.py +++ b/tests/main/clients/custom_scalars/expected_client/async_base_client.py @@ -16,8 +16,15 @@ ) try: - from websockets.client import WebSocketClientProtocol, connect as ws_connect - from websockets.typing import Data, Origin, Subprotocol + from websockets.client import ( # type: ignore[import-not-found,unused-ignore] + WebSocketClientProtocol, + connect as ws_connect, + ) + from websockets.typing import ( # type: ignore[import-not-found,unused-ignore] + Data, + Origin, + Subprotocol, + ) except ImportError: from contextlib import asynccontextmanager @@ -26,9 +33,9 @@ async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument raise NotImplementedError("Subscriptions require 'websockets' package.") yield # pylint: disable=unreachable - WebSocketClientProtocol = Any # type: ignore - Data = Any # type: ignore - Origin = Any # type: ignore + WebSocketClientProtocol = Any # type: ignore[misc,assignment,unused-ignore] + Data = Any # type: ignore[misc,assignment,unused-ignore] + Origin = Any # type: ignore[misc,assignment,unused-ignore] def Subprotocol(*args, **kwargs): # type: ignore # pylint: disable=invalid-name raise NotImplementedError("Subscriptions require 'websockets' package.") diff --git a/tests/main/clients/example/expected_client/async_base_client.py b/tests/main/clients/example/expected_client/async_base_client.py index fd727d35..d49c347c 100644 --- a/tests/main/clients/example/expected_client/async_base_client.py +++ b/tests/main/clients/example/expected_client/async_base_client.py @@ -16,8 +16,15 @@ ) try: - from websockets.client import WebSocketClientProtocol, connect as ws_connect - from websockets.typing import Data, Origin, Subprotocol + from websockets.client import ( # type: ignore[import-not-found,unused-ignore] + WebSocketClientProtocol, + connect as ws_connect, + ) + from websockets.typing import ( # type: ignore[import-not-found,unused-ignore] + Data, + Origin, + Subprotocol, + ) except ImportError: from contextlib import asynccontextmanager @@ -26,9 +33,9 @@ async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument raise NotImplementedError("Subscriptions require 'websockets' package.") yield # pylint: disable=unreachable - WebSocketClientProtocol = Any # type: ignore - Data = Any # type: ignore - Origin = Any # type: ignore + WebSocketClientProtocol = Any # type: ignore[misc,assignment,unused-ignore] + Data = Any # type: ignore[misc,assignment,unused-ignore] + Origin = Any # type: ignore[misc,assignment,unused-ignore] def Subprotocol(*args, **kwargs): # type: ignore # pylint: disable=invalid-name raise NotImplementedError("Subscriptions require 'websockets' package.") diff --git a/tests/main/clients/extended_models/expected_client/async_base_client.py b/tests/main/clients/extended_models/expected_client/async_base_client.py index fd727d35..d49c347c 100644 --- a/tests/main/clients/extended_models/expected_client/async_base_client.py +++ b/tests/main/clients/extended_models/expected_client/async_base_client.py @@ -16,8 +16,15 @@ ) try: - from websockets.client import WebSocketClientProtocol, connect as ws_connect - from websockets.typing import Data, Origin, Subprotocol + from websockets.client import ( # type: ignore[import-not-found,unused-ignore] + WebSocketClientProtocol, + connect as ws_connect, + ) + from websockets.typing import ( # type: ignore[import-not-found,unused-ignore] + Data, + Origin, + Subprotocol, + ) except ImportError: from contextlib import asynccontextmanager @@ -26,9 +33,9 @@ async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument raise NotImplementedError("Subscriptions require 'websockets' package.") yield # pylint: disable=unreachable - WebSocketClientProtocol = Any # type: ignore - Data = Any # type: ignore - Origin = Any # type: ignore + WebSocketClientProtocol = Any # type: ignore[misc,assignment,unused-ignore] + Data = Any # type: ignore[misc,assignment,unused-ignore] + Origin = Any # type: ignore[misc,assignment,unused-ignore] def Subprotocol(*args, **kwargs): # type: ignore # pylint: disable=invalid-name raise NotImplementedError("Subscriptions require 'websockets' package.") diff --git a/tests/main/clients/fragments_on_abstract_types/expected_client/async_base_client.py b/tests/main/clients/fragments_on_abstract_types/expected_client/async_base_client.py index fd727d35..d49c347c 100644 --- a/tests/main/clients/fragments_on_abstract_types/expected_client/async_base_client.py +++ b/tests/main/clients/fragments_on_abstract_types/expected_client/async_base_client.py @@ -16,8 +16,15 @@ ) try: - from websockets.client import WebSocketClientProtocol, connect as ws_connect - from websockets.typing import Data, Origin, Subprotocol + from websockets.client import ( # type: ignore[import-not-found,unused-ignore] + WebSocketClientProtocol, + connect as ws_connect, + ) + from websockets.typing import ( # type: ignore[import-not-found,unused-ignore] + Data, + Origin, + Subprotocol, + ) except ImportError: from contextlib import asynccontextmanager @@ -26,9 +33,9 @@ async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument raise NotImplementedError("Subscriptions require 'websockets' package.") yield # pylint: disable=unreachable - WebSocketClientProtocol = Any # type: ignore - Data = Any # type: ignore - Origin = Any # type: ignore + WebSocketClientProtocol = Any # type: ignore[misc,assignment,unused-ignore] + Data = Any # type: ignore[misc,assignment,unused-ignore] + Origin = Any # type: ignore[misc,assignment,unused-ignore] def Subprotocol(*args, **kwargs): # type: ignore # pylint: disable=invalid-name raise NotImplementedError("Subscriptions require 'websockets' package.") diff --git a/tests/main/clients/inline_fragments/expected_client/async_base_client.py b/tests/main/clients/inline_fragments/expected_client/async_base_client.py index fd727d35..d49c347c 100644 --- a/tests/main/clients/inline_fragments/expected_client/async_base_client.py +++ b/tests/main/clients/inline_fragments/expected_client/async_base_client.py @@ -16,8 +16,15 @@ ) try: - from websockets.client import WebSocketClientProtocol, connect as ws_connect - from websockets.typing import Data, Origin, Subprotocol + from websockets.client import ( # type: ignore[import-not-found,unused-ignore] + WebSocketClientProtocol, + connect as ws_connect, + ) + from websockets.typing import ( # type: ignore[import-not-found,unused-ignore] + Data, + Origin, + Subprotocol, + ) except ImportError: from contextlib import asynccontextmanager @@ -26,9 +33,9 @@ async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument raise NotImplementedError("Subscriptions require 'websockets' package.") yield # pylint: disable=unreachable - WebSocketClientProtocol = Any # type: ignore - Data = Any # type: ignore - Origin = Any # type: ignore + WebSocketClientProtocol = Any # type: ignore[misc,assignment,unused-ignore] + Data = Any # type: ignore[misc,assignment,unused-ignore] + Origin = Any # type: ignore[misc,assignment,unused-ignore] def Subprotocol(*args, **kwargs): # type: ignore # pylint: disable=invalid-name raise NotImplementedError("Subscriptions require 'websockets' package.") diff --git a/tests/main/clients/multiple_fragments/expected_client/async_base_client.py b/tests/main/clients/multiple_fragments/expected_client/async_base_client.py index fd727d35..d49c347c 100644 --- a/tests/main/clients/multiple_fragments/expected_client/async_base_client.py +++ b/tests/main/clients/multiple_fragments/expected_client/async_base_client.py @@ -16,8 +16,15 @@ ) try: - from websockets.client import WebSocketClientProtocol, connect as ws_connect - from websockets.typing import Data, Origin, Subprotocol + from websockets.client import ( # type: ignore[import-not-found,unused-ignore] + WebSocketClientProtocol, + connect as ws_connect, + ) + from websockets.typing import ( # type: ignore[import-not-found,unused-ignore] + Data, + Origin, + Subprotocol, + ) except ImportError: from contextlib import asynccontextmanager @@ -26,9 +33,9 @@ async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument raise NotImplementedError("Subscriptions require 'websockets' package.") yield # pylint: disable=unreachable - WebSocketClientProtocol = Any # type: ignore - Data = Any # type: ignore - Origin = Any # type: ignore + WebSocketClientProtocol = Any # type: ignore[misc,assignment,unused-ignore] + Data = Any # type: ignore[misc,assignment,unused-ignore] + Origin = Any # type: ignore[misc,assignment,unused-ignore] def Subprotocol(*args, **kwargs): # type: ignore # pylint: disable=invalid-name raise NotImplementedError("Subscriptions require 'websockets' package.") diff --git a/tests/main/clients/only_used_inputs_and_enums/expected_client/async_base_client.py b/tests/main/clients/only_used_inputs_and_enums/expected_client/async_base_client.py index fd727d35..d49c347c 100644 --- a/tests/main/clients/only_used_inputs_and_enums/expected_client/async_base_client.py +++ b/tests/main/clients/only_used_inputs_and_enums/expected_client/async_base_client.py @@ -16,8 +16,15 @@ ) try: - from websockets.client import WebSocketClientProtocol, connect as ws_connect - from websockets.typing import Data, Origin, Subprotocol + from websockets.client import ( # type: ignore[import-not-found,unused-ignore] + WebSocketClientProtocol, + connect as ws_connect, + ) + from websockets.typing import ( # type: ignore[import-not-found,unused-ignore] + Data, + Origin, + Subprotocol, + ) except ImportError: from contextlib import asynccontextmanager @@ -26,9 +33,9 @@ async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument raise NotImplementedError("Subscriptions require 'websockets' package.") yield # pylint: disable=unreachable - WebSocketClientProtocol = Any # type: ignore - Data = Any # type: ignore - Origin = Any # type: ignore + WebSocketClientProtocol = Any # type: ignore[misc,assignment,unused-ignore] + Data = Any # type: ignore[misc,assignment,unused-ignore] + Origin = Any # type: ignore[misc,assignment,unused-ignore] def Subprotocol(*args, **kwargs): # type: ignore # pylint: disable=invalid-name raise NotImplementedError("Subscriptions require 'websockets' package.") diff --git a/tests/main/clients/operations/expected_client/async_base_client.py b/tests/main/clients/operations/expected_client/async_base_client.py index fd727d35..d49c347c 100644 --- a/tests/main/clients/operations/expected_client/async_base_client.py +++ b/tests/main/clients/operations/expected_client/async_base_client.py @@ -16,8 +16,15 @@ ) try: - from websockets.client import WebSocketClientProtocol, connect as ws_connect - from websockets.typing import Data, Origin, Subprotocol + from websockets.client import ( # type: ignore[import-not-found,unused-ignore] + WebSocketClientProtocol, + connect as ws_connect, + ) + from websockets.typing import ( # type: ignore[import-not-found,unused-ignore] + Data, + Origin, + Subprotocol, + ) except ImportError: from contextlib import asynccontextmanager @@ -26,9 +33,9 @@ async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument raise NotImplementedError("Subscriptions require 'websockets' package.") yield # pylint: disable=unreachable - WebSocketClientProtocol = Any # type: ignore - Data = Any # type: ignore - Origin = Any # type: ignore + WebSocketClientProtocol = Any # type: ignore[misc,assignment,unused-ignore] + Data = Any # type: ignore[misc,assignment,unused-ignore] + Origin = Any # type: ignore[misc,assignment,unused-ignore] def Subprotocol(*args, **kwargs): # type: ignore # pylint: disable=invalid-name raise NotImplementedError("Subscriptions require 'websockets' package.") diff --git a/tests/main/clients/remote_schema/expected_client/async_base_client.py b/tests/main/clients/remote_schema/expected_client/async_base_client.py index fd727d35..d49c347c 100644 --- a/tests/main/clients/remote_schema/expected_client/async_base_client.py +++ b/tests/main/clients/remote_schema/expected_client/async_base_client.py @@ -16,8 +16,15 @@ ) try: - from websockets.client import WebSocketClientProtocol, connect as ws_connect - from websockets.typing import Data, Origin, Subprotocol + from websockets.client import ( # type: ignore[import-not-found,unused-ignore] + WebSocketClientProtocol, + connect as ws_connect, + ) + from websockets.typing import ( # type: ignore[import-not-found,unused-ignore] + Data, + Origin, + Subprotocol, + ) except ImportError: from contextlib import asynccontextmanager @@ -26,9 +33,9 @@ async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument raise NotImplementedError("Subscriptions require 'websockets' package.") yield # pylint: disable=unreachable - WebSocketClientProtocol = Any # type: ignore - Data = Any # type: ignore - Origin = Any # type: ignore + WebSocketClientProtocol = Any # type: ignore[misc,assignment,unused-ignore] + Data = Any # type: ignore[misc,assignment,unused-ignore] + Origin = Any # type: ignore[misc,assignment,unused-ignore] def Subprotocol(*args, **kwargs): # type: ignore # pylint: disable=invalid-name raise NotImplementedError("Subscriptions require 'websockets' package.") diff --git a/tests/main/clients/shorter_results/expected_client/async_base_client.py b/tests/main/clients/shorter_results/expected_client/async_base_client.py index fd727d35..d49c347c 100644 --- a/tests/main/clients/shorter_results/expected_client/async_base_client.py +++ b/tests/main/clients/shorter_results/expected_client/async_base_client.py @@ -16,8 +16,15 @@ ) try: - from websockets.client import WebSocketClientProtocol, connect as ws_connect - from websockets.typing import Data, Origin, Subprotocol + from websockets.client import ( # type: ignore[import-not-found,unused-ignore] + WebSocketClientProtocol, + connect as ws_connect, + ) + from websockets.typing import ( # type: ignore[import-not-found,unused-ignore] + Data, + Origin, + Subprotocol, + ) except ImportError: from contextlib import asynccontextmanager @@ -26,9 +33,9 @@ async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument raise NotImplementedError("Subscriptions require 'websockets' package.") yield # pylint: disable=unreachable - WebSocketClientProtocol = Any # type: ignore - Data = Any # type: ignore - Origin = Any # type: ignore + WebSocketClientProtocol = Any # type: ignore[misc,assignment,unused-ignore] + Data = Any # type: ignore[misc,assignment,unused-ignore] + Origin = Any # type: ignore[misc,assignment,unused-ignore] def Subprotocol(*args, **kwargs): # type: ignore # pylint: disable=invalid-name raise NotImplementedError("Subscriptions require 'websockets' package.")