Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move websockets from legacy to asyncio #1572

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/onegov/websockets/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import click
from sentry_sdk import init as init_sentry
from websockets.legacy.client import connect
from websockets.asyncio.client import connect

from onegov.core.cli import command_group, pass_group_context
from onegov.websockets.client import authenticate
Expand Down
2 changes: 1 addition & 1 deletion src/onegov/websockets/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from onegov.core.types import JSON_ro
from websockets.legacy.client import WebSocketClientProtocol
from websockets.client import WebSocketClientProtocol


async def acknowledged(websocket: 'WebSocketClientProtocol') -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/onegov/websockets/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from onegov.websockets.client import broadcast
from urllib.parse import ParseResult
from urllib.parse import urlparse
from websockets.legacy.client import connect
from websockets.asyncio.client import connect


from typing import Any
Expand Down
5 changes: 2 additions & 3 deletions src/onegov/websockets/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
from itsdangerous import BadSignature, Signer
from markupsafe import escape
from websockets.exceptions import ConnectionClosed, InvalidOrigin
from websockets.legacy.protocol import broadcast
from websockets.legacy.server import WebSocketServerProtocol, serve
from websockets.server import WebSocketServerProtocol, serve, broadcast

from onegov.chat.collections import ChatCollection
from onegov.chat.utils import param_from_path
Expand All @@ -30,7 +29,7 @@

from sqlalchemy.orm import Session
from websockets import Headers
from websockets.legacy.server import HTTPResponse
from websockets.asyncio.server import HTTPResponse

from onegov.chat.models import Chat
from onegov.core.types import JSONObject, JSONObject_ro
Expand Down
2 changes: 1 addition & 1 deletion tests/onegov/websockets/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from onegov.websockets.client import status
from pytest import mark
from tests.onegov.websockets.conftest import WebsocketsRoot
from websockets import connect
from websockets.asyncio.client import connect


@mark.asyncio
Expand Down
2 changes: 1 addition & 1 deletion tests/onegov/websockets/test_client_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from onegov.websockets.client import status
from pytest import mark
from pytest import raises
from websockets import connect
from websockets.asyncio.client import connect


@mark.asyncio
Expand Down
Loading