Skip to content

Commit

Permalink
Bump websockets version
Browse files Browse the repository at this point in the history
  • Loading branch information
leonhard-s committed Jun 28, 2021
1 parent d67574a commit 0a85df9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
python -m pip install aiohttp backoff coverage coveralls pydantic websockets==8.1 yarl
python -m pip install aiohttp backoff coverage coveralls pydantic websockets>=9.1 yarl
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pythonunittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install aiohttp backoff coverage coveralls pydantic websockets==8.1 yarl
pip install aiohttp backoff coverage coveralls pydantic websockets>=9.1 yarl
- name: Run tests
env:
SERVICE_ID: ${{secrets.REPO_SERVICE_ID}}
Expand Down
11 changes: 6 additions & 5 deletions auraxium/event/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
import logging
from typing import (Any, Callable, Coroutine, Dict, Iterator, List, Optional, Type, TypeVar, Union,
cast, overload)

import backoff
import pydantic

import websockets
import websockets.exceptions
from websockets.legacy import client as ws_client

from .._client import Client
from ..models import Event
from ..types import CensusData

from ._trigger import Trigger

__all__ = [
Expand Down Expand Up @@ -55,7 +56,7 @@ class EventClient(Client):
registered for the client.
.. attribute:: websocket
:type: websockets.client.WebSocketClientProtocol | None
:type: websockets.client.legacy.WebSocketClientProtocol | None
The websocket client used for the real-time event stream. This
will be automatically opened and closed by the client as event
Expand All @@ -65,7 +66,7 @@ class EventClient(Client):
def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
self.triggers: List[Trigger] = []
self.websocket: Optional[websockets.WebSocketClientProtocol] = None
self.websocket: Optional[ws_client.WebSocketClientProtocol] = None
self._connect_lock = asyncio.Lock()
self._connected: bool = False
self._endpoint_status: Dict[str, bool] = {}
Expand Down Expand Up @@ -263,7 +264,7 @@ async def _connection_handler(self) -> None:
"""
_log.info('Connecting to WebSocket endpoint...')
url = f'{_ESS_ENDPOINT}?environment=ps2&service-id={self.service_id}'
async with websockets.connect(url) as websocket:
async with ws_client.connect(url) as websocket:
self.websocket = websocket
_log.info('Connected to %s?environment=ps2&service-id=XXX',
_ESS_ENDPOINT)
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ backoff
pydantic
requests
yarl
websockets == 8.1
websockets >= 9.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'backoff',
'pydantic',
'yarl',
'websockets==8.1'],
'websockets>=9.1'],
license='MIT',
include_package_data=True,
zip_safe=False)

0 comments on commit 0a85df9

Please sign in to comment.