Skip to content

Commit

Permalink
Use entrypoint instead of runpy in docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaugustin committed Feb 25, 2025
1 parent f4e4345 commit 3c62503
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 28 deletions.
6 changes: 3 additions & 3 deletions docs/deploy/fly.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ name of your Fly app in this command:

.. code-block:: console
$ python -m websockets wss://websockets-echo.fly.dev/
$ websockets wss://websockets-echo.fly.dev/
Connected to wss://websockets-echo.fly.dev/.
>
Expand All @@ -152,7 +152,7 @@ with your app:

.. code-block:: console
$ python -m websockets wss://websockets-echo.fly.dev/
$ websockets wss://websockets-echo.fly.dev/
Connected to wss://websockets-echo.fly.dev/.
>
Expand All @@ -169,7 +169,7 @@ away).

.. code-block:: console
$ python -m websockets wss://websockets-echo.fly.dev/
$ websockets wss://websockets-echo.fly.dev/
Connected to wss://websockets-echo.fly.dev/.
Connection closed: 1001 (going away).
Expand Down
2 changes: 1 addition & 1 deletion docs/deploy/haproxy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ You can confirm that HAProxy proxies connections properly:

.. code-block:: console
$ PYTHONPATH=src python -m websockets ws://localhost:8080/
$ PYTHONPATH=src websockets ws://localhost:8080/
Connected to ws://localhost:8080/.
> Hello!
< Hello!
Expand Down
6 changes: 3 additions & 3 deletions docs/deploy/heroku.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ name of your Heroku app in this command:

.. code-block:: console
$ python -m websockets wss://websockets-echo.herokuapp.com/
$ websockets wss://websockets-echo.herokuapp.com/
Connected to wss://websockets-echo.herokuapp.com/.
>
Expand All @@ -156,7 +156,7 @@ with your app:

.. code-block:: console
$ python -m websockets wss://websockets-echo.herokuapp.com/
$ websockets wss://websockets-echo.herokuapp.com/
Connected to wss://websockets-echo.herokuapp.com/.
>
Expand All @@ -173,7 +173,7 @@ away).

.. code-block:: console
$ python -m websockets wss://websockets-echo.herokuapp.com/
$ websockets wss://websockets-echo.herokuapp.com/
Connected to wss://websockets-echo.herokuapp.com/.
Connection closed: 1001 (going away).
Expand Down
6 changes: 3 additions & 3 deletions docs/deploy/koyeb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ interactive client — you must replace ``https`` with ``wss`` in the URL:

.. code-block:: console
$ python -m websockets wss://<app>-<user>-<id>.koyeb.app/
$ websockets wss://<app>-<user>-<id>.koyeb.app/
Connected to wss://<app>-<user>-<id>.koyeb.app/.
>
Expand All @@ -145,7 +145,7 @@ Connect an interactive client again:

.. code-block:: console
$ python -m websockets wss://<app>-<user>-<id>.koyeb.app/
$ websockets wss://<app>-<user>-<id>.koyeb.app/
Connected to wss://<app>-<user>-<id>.koyeb.app/.
>
Expand All @@ -156,7 +156,7 @@ Eventually, the connection gets closed with code 1001 (going away).

.. code-block:: console
$ python -m websockets wss://<app>-<user>-<id>.koyeb.app/
$ websockets wss://<app>-<user>-<id>.koyeb.app/
Connected to wss://<app>-<user>-<id>.koyeb.app/.
Connection closed: 1001 (going away).
Expand Down
6 changes: 3 additions & 3 deletions docs/deploy/kubernetes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ to the app and check that it echoes anything you send:

.. code-block:: console
$ python -m websockets ws://localhost:32080/
$ websockets ws://localhost:32080/
Connected to ws://localhost:32080/.
> Hey there!
< Hey there!
Expand All @@ -71,7 +71,7 @@ shut down gracefully:

.. code-block:: console
$ python -m websockets ws://localhost:32080/
$ websockets ws://localhost:32080/
Connected to ws://localhost:32080/.
> Hey there!
< Hey there!
Expand Down Expand Up @@ -119,7 +119,7 @@ You can connect to the service — press Ctrl-D to exit:

.. code-block:: console
$ python -m websockets ws://localhost:32080/
$ websockets ws://localhost:32080/
Connected to ws://localhost:32080/.
Connection closed: 1000 (OK).
Expand Down
2 changes: 1 addition & 1 deletion docs/deploy/nginx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ You can confirm that nginx proxies connections properly:

.. code-block:: console
$ PYTHONPATH=src python -m websockets ws://localhost:8080/
$ PYTHONPATH=src websockets ws://localhost:8080/
Connected to ws://localhost:8080/.
> Hello!
< Hello!
Expand Down
6 changes: 3 additions & 3 deletions docs/deploy/render.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ name of your Render app in this command:

.. code-block:: console
$ python -m websockets wss://websockets-echo.onrender.com/
$ websockets wss://websockets-echo.onrender.com/
Connected to wss://websockets-echo.onrender.com/.
>
Expand All @@ -153,7 +153,7 @@ with your app:

.. code-block:: console
$ python -m websockets wss://websockets-echo.onrender.com/
$ websockets wss://websockets-echo.onrender.com/
Connected to wss://websockets-echo.onrender.com/.
>
Expand All @@ -162,7 +162,7 @@ deployment completes, the connection is closed with code 1001 (going away).

.. code-block:: console
$ python -m websockets wss://websockets-echo.onrender.com/
$ websockets wss://websockets-echo.onrender.com/
Connected to wss://websockets-echo.onrender.com/.
Connection closed: 1001 (going away).
Expand Down
7 changes: 3 additions & 4 deletions docs/deploy/supervisor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ press Ctrl-D to exit:

.. code-block:: console
$ python -m websockets ws://localhost:8080/
$ websockets ws://localhost:8080/
Connected to ws://localhost:8080/.
> Hello!
< Hello!
Expand All @@ -89,7 +89,7 @@ establish a connection and leave it open:

.. code-block:: console
$ python -m websockets ws://localhost:8080/
$ websockets ws://localhost:8080/
Connected to ws://localhost:8080/.
>
Expand All @@ -115,7 +115,7 @@ And you can see that the connection to the app was closed gracefully:

.. code-block:: console
$ python -m websockets ws://localhost:8080/
$ websockets ws://localhost:8080/
Connected to ws://localhost:8080/.
Connection closed: 1001 (going away).
Expand All @@ -128,4 +128,3 @@ In a real deployment, you would likely:
* Create a virtualenv dedicated to your application.
* Add ``environment=PATH="path/to/your/virtualenv/bin"`` in the Supervisor
configuration. Then ``python app.py`` runs in that virtualenv.

4 changes: 2 additions & 2 deletions docs/howto/django.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ prompt:

.. code-block:: console
$ python -m websockets ws://localhost:8888/
$ websockets ws://localhost:8888/
Connected to ws://localhost:8888/
> <your token>
< Hello <your username>!
Expand All @@ -157,7 +157,7 @@ closes the connection:

.. code-block:: console
$ python -m websockets ws://localhost:8888/
$ websockets ws://localhost:8888/
Connected to ws://localhost:8888.
> not a token
Connection closed: 1011 (internal error) authentication failed.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Also, websockets provides an interactive client:

.. code-block:: console
$ python -m websockets ws://localhost:8765/
$ websockets ws://localhost:8765/
Connected to ws://localhost:8765/.
> Hello world!
< Hello world!
Expand Down
4 changes: 2 additions & 2 deletions docs/intro/tutorial1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Confirm that websockets is installed:

.. code-block:: console
$ python -m websockets --version
$ websockets --version
.. admonition:: This tutorial is written for websockets |release|.
:class: tip
Expand Down Expand Up @@ -239,7 +239,7 @@ Open another shell and run this command:

.. code-block:: console
$ python -m websockets ws://localhost:8001/
$ websockets ws://localhost:8001/
You get a prompt. Type a message and press "Enter". Switch to the shell where
the server is running and check that the server received the message. Good!
Expand Down
2 changes: 1 addition & 1 deletion docs/intro/tutorial3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ of your app in the format: ``https://<app>-<user>-<id>.koyeb.app/``. Replace

.. code-block:: console
$ python -m websockets wss://<app>-<user>-<id>.koyeb.app/
$ websockets wss://<app>-<user>-<id>.koyeb.app/
Connected to wss://<app>-<user>-<id>.koyeb.app/.
> {"type": "init"}
< {"type": "init", "join": "54ICxFae_Ip7TJE2", "watch": "634w44TblL5Dbd9a"}
Expand Down
2 changes: 1 addition & 1 deletion src/websockets/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async def interactive_client(uri: str) -> None:

def main() -> None:
parser = argparse.ArgumentParser(
prog="python -m websockets",
prog="websockets",
description="Interactive WebSocket client.",
add_help=False,
)
Expand Down

0 comments on commit 3c62503

Please sign in to comment.