Skip to content

Commit

Permalink
Rename handler modules to disambiguate from decorator names.
Browse files Browse the repository at this point in the history
Closes #1162
  • Loading branch information
peterschutt committed Feb 8, 2023
1 parent a8cb864 commit 917e8ae
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion starlite/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
ImproperlyConfiguredException,
NoRouteMatchFoundException,
)
from starlite.handlers.http import HTTPRouteHandler
from starlite.handlers.http_handlers import HTTPRouteHandler
from starlite.middleware.cors import CORSMiddleware
from starlite.openapi.path_item import create_path_item
from starlite.router import Router
Expand Down
2 changes: 1 addition & 1 deletion starlite/connection/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from starlite.utils.serialization import decode_json, decode_msgpack

if TYPE_CHECKING:
from starlite.handlers.http import HTTPRouteHandler # noqa: F401
from starlite.handlers.http_handlers import HTTPRouteHandler # noqa: F401
from starlite.types.asgi_types import HTTPScope, Method, Receive, Scope, Send


Expand Down
2 changes: 1 addition & 1 deletion starlite/connection/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from starlite.utils.serialization import decode_json, default_serializer, encode_json

if TYPE_CHECKING:
from starlite.handlers.websocket import WebsocketRouteHandler # noqa: F401
from starlite.handlers.websocket_handlers import WebsocketRouteHandler # noqa: F401
from starlite.types import Message, Serializer, WebSocketScope
from starlite.types.asgi_types import WebSocketDisconnectEvent # nopycln: import
from starlite.types.asgi_types import WebSocketReceiveEvent # nopycln: import
Expand Down
6 changes: 3 additions & 3 deletions starlite/handlers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .asgi import ASGIRouteHandler, asgi
from .asgi_handlers import ASGIRouteHandler, asgi
from .base import BaseRouteHandler
from .http import HTTPRouteHandler, delete, get, head, patch, post, put, route
from .websocket import WebsocketRouteHandler, websocket
from .http_handlers import HTTPRouteHandler, delete, get, head, patch, post, put, route
from .websocket_handlers import WebsocketRouteHandler, websocket

__all__ = (
"ASGIRouteHandler",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion starlite/routes/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from starlite.utils.helpers import unwrap_partial

if TYPE_CHECKING:
from starlite.handlers.asgi import ASGIRouteHandler
from starlite.handlers.asgi_handlers import ASGIRouteHandler
from starlite.types import Receive, Scope, Send


Expand Down
2 changes: 1 addition & 1 deletion starlite/routes/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
ImproperlyConfiguredException,
SerializationException,
)
from starlite.handlers.http import HTTPRouteHandler
from starlite.handlers.http_handlers import HTTPRouteHandler
from starlite.response import Response
from starlite.routes.base import BaseRoute
from starlite.status_codes import HTTP_204_NO_CONTENT, HTTP_400_BAD_REQUEST
Expand Down
2 changes: 1 addition & 1 deletion starlite/routes/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

if TYPE_CHECKING:
from starlite.connection import WebSocket
from starlite.handlers.websocket import WebsocketRouteHandler
from starlite.handlers.websocket_handlers import WebsocketRouteHandler
from starlite.kwargs import KwargsModel
from starlite.kwargs.cleanup import DependencyCleanupGroup
from starlite.types import Receive, Send, WebSocketScope
Expand Down
2 changes: 1 addition & 1 deletion starlite/testing/request_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from starlite.app import Starlite
from starlite.connection import Request
from starlite.enums import HttpMethod, ParamType, RequestEncodingType, ScopeType
from starlite.handlers.http import get
from starlite.handlers.http_handlers import get
from starlite.types import HTTPScope, RouteHandlerType
from starlite.types.asgi_types import ASGIVersion
from starlite.utils.serialization import decode_json, encode_json
Expand Down
6 changes: 3 additions & 3 deletions starlite/types/internal_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
if TYPE_CHECKING:
from starlite.app import Starlite
from starlite.controller import Controller
from starlite.handlers.asgi import ASGIRouteHandler
from starlite.handlers.http import HTTPRouteHandler
from starlite.handlers.websocket import WebsocketRouteHandler
from starlite.handlers.asgi_handlers import ASGIRouteHandler
from starlite.handlers.http_handlers import HTTPRouteHandler
from starlite.handlers.websocket_handlers import WebsocketRouteHandler
from starlite.response import Response
from starlite.router import Router
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/connection/websocket/test_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from starlite.connection import WebSocket
from starlite.datastructures.headers import Headers
from starlite.exceptions import WebSocketDisconnect, WebSocketException
from starlite.handlers.websocket import websocket
from starlite.handlers.websocket_handlers import websocket
from starlite.status_codes import WS_1001_GOING_AWAY
from starlite.testing import TestClient, create_test_client

Expand Down
2 changes: 1 addition & 1 deletion tests/handlers/http/test_kwarg_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
put,
)
from starlite.exceptions import ImproperlyConfiguredException
from starlite.handlers.http import _get_default_status_code
from starlite.handlers.http_handlers import _get_default_status_code
from starlite.status_codes import HTTP_200_OK, HTTP_201_CREATED, HTTP_204_NO_CONTENT
from starlite.types import ResponseType
from starlite.utils import normalize_path
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/tortoise_orm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from tortoise import Model, Tortoise, fields # type: ignore

from starlite.handlers.http import get, post
from starlite.handlers.http_handlers import get, post


class Tournament(Model): # type: ignore[misc]
Expand Down

0 comments on commit 917e8ae

Please sign in to comment.