Skip to content

Commit d24f7b6

Browse files
authored
Prepare for 0.3.0 release (#18)
1 parent 43f89ff commit d24f7b6

File tree

4 files changed

+28
-23
lines changed

4 files changed

+28
-23
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
dev:
44
pip install -e ".[dev]"
5+
pre-commit install
56

67
proto:
78
protoc --python_out=centrifuge/protocol client.proto

README.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# centrifuge-python (work in progress)
1+
# centrifuge-python
22

33
[![CI](https://github.com/centrifugal/centrifuge-python/actions/workflows/test.yml/badge.svg)](https://github.com/centrifugal/centrifuge-python/actions/workflows/test.yml?query=event%3Apush+branch%3Amaster+workflow%3ATest)
44
[![pypi](https://img.shields.io/pypi/v/centrifuge-python.svg)](https://pypi.python.org/pypi/centrifuge-python)
@@ -10,9 +10,7 @@ This is a WebSocket real-time SDK for [Centrifugo](https://github.com/centrifuga
1010
> [!TIP]
1111
> If you are looking for Centrifugo [server API](https://centrifugal.dev/docs/server/server_api) client – check out [pycent](https://github.com/centrifugal/pycent) instead.
1212
13-
Before starting to work with this library check out [Centrifugo client SDK API specification](https://centrifugal.dev/docs/transports/client_api) as it contains common information about Centrifugal real-time SDK behavior.
14-
15-
The features implemented by this SDK can be found in [SDK feature matrix](https://centrifugal.dev/docs/transports/client_sdk#sdk-feature-matrix).
13+
Before starting to work with this library check out [Centrifugo client SDK API specification](https://centrifugal.dev/docs/transports/client_api) as it contains common information about Centrifugal real-time SDK behavior. This SDK supports all major features of Centrifugo client protocol - see [SDK feature matrix](https://centrifugal.dev/docs/transports/client_sdk#sdk-feature-matrix).
1614

1715
## Install
1816

@@ -47,23 +45,6 @@ When using Protobuf protocol:
4745

4846
Event callbacks are called by SDK using `await` internally, the websocket connection read loop is blocked for the time SDK waits for the callback to be executed. This means that if you need to perform long operations in callbacks consider moving the work to a separate coroutine/task to return fast and continue reading data from the websocket.
4947

50-
## Run tests
51-
52-
To run tests, first start Centrifugo server:
53-
54-
```bash
55-
docker run -p 8000:8000 centrifugo/centrifugo:v5 centrifugo --client_insecure --log_level debug
56-
```
57-
58-
And then:
59-
60-
```bash
61-
python -m venv env
62-
. env/bin/activate
63-
make dev
64-
make test
65-
```
66-
6748
## Run example
6849

6950
To run [example](https://github.com/centrifugal/centrifuge-python/blob/master/example.py), first start Centrifugo with config like this:
@@ -95,3 +76,26 @@ python -m venv env
9576
make dev
9677
python example.py
9778
```
79+
80+
## Run tests
81+
82+
To run tests, first start Centrifugo server:
83+
84+
```bash
85+
docker pull centrifugo/centrifugo:v5
86+
docker run -d -p 8000:8000 -e CENTRIFUGO_TOKEN_HMAC_SECRET_KEY="secret" -e CENTRIFUGO_PRESENCE=1 \
87+
-e CENTRIFUGO_JOIN_LEAVE=true -e CENTRIFUGO_FORCE_PUSH_JOIN_LEAVE=true \
88+
-e CENTRIFUGO_HISTORY_TTL=300s -e CENTRIFUGO_HISTORY_SIZE=100 \
89+
-e CENTRIFUGO_FORCE_RECOVERY=true -e CENTRIFUGO_USER_SUBSCRIBE_TO_PERSONAL=true \
90+
-e CENTRIFUGO_ALLOW_PUBLISH_FOR_SUBSCRIBER=true -e CENTRIFUGO_ALLOW_PRESENCE_FOR_SUBSCRIBER=true \
91+
-e CENTRIFUGO_ALLOW_HISTORY_FOR_SUBSCRIBER=true centrifugo/centrifugo:v5 centrifugo
92+
```
93+
94+
And then (from cloned repo root):
95+
96+
```bash
97+
python -m venv env
98+
. env/bin/activate
99+
make dev
100+
make test
101+
```

centrifuge/__meta__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.3.0b5"
1+
__version__ = "0.3.0"

centrifuge/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ async def _handle_ping(self) -> None:
11511151

11521152
async def _send_commands(
11531153
self,
1154-
commands: Union[List[Dict[str, Any]]],
1154+
commands: List[Dict[str, Any]],
11551155
) -> None:
11561156
if self._conn is None:
11571157
raise CentrifugeError("connection is not initialized")

0 commit comments

Comments
 (0)