Skip to content

Commit db705fa

Browse files
committed
fixed example package poetry dependencies
1 parent 8ed511e commit db705fa

File tree

16 files changed

+886
-23
lines changed

16 files changed

+886
-23
lines changed

ellar/socket_io/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
try:
22
import socketio # noqa
33
except Exception as e: # pragma: no cover
4-
raise Exception("socketio package is required. Use `pip install socketio`.") from e
4+
raise Exception(
5+
"socketio package is required. Use `pip install python-socketio`."
6+
) from e
57

68
from .decorators import (
79
WebSocketGateway,

examples/01-carapp/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ packages = [{include = "03_socketio_app"}]
99

1010
[tool.poetry.dependencies]
1111
python = "^3.8"
12-
ellar-cli = "^0.1.8"
12+
ellar-cli = "^0.2.4"
1313

1414

1515
[build-system]

examples/02-socketio-app/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
A quick example of how to use ellar Websocket Gateway with python-socketio library.
33

44
## Requirements
5-
Python >= 3.7
5+
Python >= 3.8
66
Poetry
77

88
## Project setup
@@ -14,3 +14,6 @@ poetry install
1414
```
1515
ellar runserver --reload
1616
```
17+
18+
### Page
19+
visit [http://127.0.0.1:8000/events/](http://127.0.0.1:8000/events/)

examples/02-socketio-app/poetry.lock

Lines changed: 859 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/02-socketio-app/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ description = "Example of ellar with socket io"
55
authors = ["Ezeudoh Tochukwu <tochukwu.ezeudoh@gmail.com>"]
66
license = "MIT"
77
readme = "README.md"
8-
packages = [{include = "03_socketio_app"}]
98

109
[tool.poetry.dependencies]
1110
python = "^3.8"
12-
ellar-cli = "^0.1.8"
11+
ellar-cli = "^0.2.4"
12+
python-socketio = "^5.10.0"
1313

1414

1515
[build-system]

examples/02-socketio-app/socketio_app/apps/events/gateways.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async def my_broadcast_event(self, message: MessageData = WsBody()):
2222

2323
@subscribe_message("join")
2424
async def join(self, message: MessageRoom = WsBody()):
25-
self.context.server.enter_room(self.context.sid, message.room)
25+
await self.context.server.enter_room(self.context.sid, message.room)
2626
await self.context.server.emit(
2727
"my_response",
2828
{"data": "Entered room: " + message.room},
@@ -31,7 +31,7 @@ async def join(self, message: MessageRoom = WsBody()):
3131

3232
@subscribe_message("leave")
3333
async def leave(self, message: MessageRoom = WsBody()):
34-
self.context.server.leave_room(self.context.sid, message.room)
34+
await self.context.server.leave_room(self.context.sid, message.room)
3535
await self.context.server.emit(
3636
"my_response", {"data": "Left room: " + message.room}, room=self.context.sid
3737
)

examples/02-socketio-app/socketio_app/apps/events/routers.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

examples/02-socketio-app/socketio_app/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class BaseConfig(ConfigDefaultTypesMixin):
3333
VERSIONING_SCHEME: BaseAPIVersioning = DefaultAPIVersioning()
3434

3535
# Enable or Disable Application Router route searching by appending backslash
36-
REDIRECT_SLASHES: bool = False
36+
REDIRECT_SLASHES: bool = True
3737

3838
# Define references to static folders in python packages.
3939
# eg STATIC_FOLDER_PACKAGES = [('boostrap4', 'statics')]

examples/02-socketio-app/socketio_app/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22

3+
from ellar.app import AppFactory
34
from ellar.common.constants import ELLAR_CONFIG_MODULE
4-
from ellar.core.factory import AppFactory
55

66
# from ellar.openapi import OpenAPIDocumentModule, OpenAPIDocumentBuilder, SwaggerUI
77
from .root_module import ApplicationModule

examples/03-auth-with-guards/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ poetry install
1414
```
1515
ellar runserver --reload
1616
```
17+
18+
### Page
19+
visit [http://127.0.0.1:8000/docs/](http://127.0.0.1:8000/docs/)

0 commit comments

Comments
 (0)