From c6aea0c7f4684a4463791bc905f17cefc9a451f1 Mon Sep 17 00:00:00 2001 From: taras Date: Fri, 13 Sep 2024 17:00:20 +0200 Subject: [PATCH] Added "Contributing / Building From Source" --- README.rst | 50 +++++++++++++++++++++++++++++++++++--- requirements-benchmark.txt | 2 ++ 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index a7eec2f..432b216 100644 --- a/README.rst +++ b/README.rst @@ -32,6 +32,12 @@ Use pip to install it:: $ pip install picows + +Documentation +============= + +https://picows.readthedocs.io/en/stable/ + Rationale ========= Popular WebSocket libraries attempt to provide high-level interfaces. They take care of timeouts, flow control, optional compression/decompression, assembling WebSocket messages from frames, as well as implementing async iteration interfaces. @@ -131,7 +137,45 @@ Features * Ability to check if a frame is the last one in the receiving buffer * Support both secure and unsecure protocols (ws and wss schemes) -Documentation -============= +Contributing / Building From Source +=================================== +1. Fork and clone the repository:: + + $ git clone git@github.com:tarasko/picows.git + $ cd picows + +2. Create a virtual environment and activate it:: + + $ python3 -m venv picows-dev + $ source picows-dev/bin/activate + + +3. Install development dependencies:: + + # To run tests + $ pip install -r requirements-test.txt + + # To run benchmark + $ pip install -r requirements-benchmark.txt + + # To build docs + $ pip install -r docs/requirements.txt + +4. Build inplace and run tests:: + + $ export PICOWS_BUILD_EXAMPLES=1 + $ python setup.py build_ext --inplace + $ pytest -s -v + + # Run specific test + $ pytest -s -v -k test_client_handshake_timeout[uvloop-plain] + +5. Run benchmark:: + + $ python -m examples.echo_server + $ python -m examples.echo_client + +6. Build docs:: + + $ make -C docs clean html -https://picows.readthedocs.io/en/stable/ diff --git a/requirements-benchmark.txt b/requirements-benchmark.txt index 7368480..c5393db 100644 --- a/requirements-benchmark.txt +++ b/requirements-benchmark.txt @@ -1,3 +1,5 @@ websockets aiohttp +numpy +matplotlib uvloop; sys_platform != 'win32'