Skip to content

Commit 7dfcc7b

Browse files
huynguyengl99carltongibson
authored andcommitted
Add types extra and installation docs for type checking support.
1 parent 95589a7 commit 7dfcc7b

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

docs/community.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ These projects from the community are developed on top of Channels:
1616
* channels-valkey_, a Django Channels channel layer that uses valkey as it's backing store.
1717
SimpleJWT_ middleware, such as QueryStringSimpleJWTAuthTokenMiddleware_ for WebSocket
1818
authentication.
19+
* types-channels_, type stubs for Channels from the `Python typeshed project`_.
20+
These stubs provide type checking support for mypy, PyCharm, and other type checkers.
1921

2022
If you'd like to add your project, please submit a PR with a link and brief description.
2123

@@ -33,3 +35,5 @@ If you'd like to add your project, please submit a PR with a link and brief desc
3335
.. _channels-valkey: https://github.com/amirreza8002/channels_valkey
3436
.. _SimpleJWT: https://github.com/jazzband/djangorestframework-simplejwt
3537
.. _QueryStringSimpleJWTAuthTokenMiddleware: https://github.com/YegorDB/django-channels-auth-token-middlewares/tree/master/tutorial/drf#querystringsimplejwtauthtokenmiddleware
38+
.. _types-channels: https://pypi.org/project/types-channels/
39+
.. _Python typeshed project: https://github.com/python/typeshed

docs/installation.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,22 @@ take control of the ``runserver`` command. See :doc:`introduction` for more.
6969
or remove the offending app altogether.
7070

7171

72+
Type checking support
73+
---------------------
74+
75+
If you want type checking support, you can install the type stubs:
76+
77+
.. code-block:: sh
78+
79+
python -m pip install types-channels
80+
81+
Or install channels with type support using the ``types`` extra:
82+
83+
.. code-block:: sh
84+
85+
python -m pip install 'channels[types]'
86+
87+
7288
Installing the latest development version
7389
-----------------------------------------
7490

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ tests =
4545
selenium
4646
daphne =
4747
daphne>=4.0.0
48+
types =
49+
types-channels
4850

4951
[options.packages.find]
5052
exclude =

0 commit comments

Comments
 (0)