Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,10 @@ Make sure the tests pass:

.. code-block:: sh

python -m pip install -e .[tests,daphne]
python -m pip install -e . --group tests
python -m pip install -e ".[daphne]"
pytest

.. note::
If you're using ``zsh`` for your shell, the above command will fail with a
``zsh: no matches found: .[tests]`` error.
To fix this use ``noglob``::

noglob python -m pip install -e .[tests]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this note because the note was specific to .[tests], and we will not use that syntax for tests.

For extras like daphne, we use now '.[daphne]' which also avoids the zsh issue

Make your change. Add tests for your change. Make the tests pass:

.. code-block:: sh
Expand Down
6 changes: 3 additions & 3 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ your environment:
.. code-block:: sh

cd channels/
python -m pip install -e .[tests]
python -m pip install -e . --group tests

Note the ``[tests]`` section there; that tells ``pip`` that you want to install
the ``tests`` extra, which will bring in testing dependencies like
Note the ``--group tests`` section there; that tells ``pip`` that you want to install
the ``tests`` dependency group from ``pyproject.toml``, which will bring in testing dependencies like
``pytest-django``.

Then, you can run the tests:
Expand Down
76 changes: 76 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,79 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "channels"
description = "Brings async, event-driven capabilities to Django."
readme = "README.rst"
license = "BSD-3-Clause"
license-files = [ "LICENSE" ]
authors = [ { name = "Django Software Foundation", email = "foundation@djangoproject.com" } ]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Framework :: Django",
"Framework :: Django :: 5.2",
"Framework :: Django :: 6.0",
"Topic :: Internet :: WWW/HTTP",
]
dynamic = [ "version" ]

dependencies = [
"Django>=5.2",
"asgiref>=3.9.0,<4",
]


[project.optional-dependencies]
daphne = [
"daphne>=4.0.0",
]
types = [
"types-channels",
]

[dependency-groups]
Comment thread
p-r-a-v-i-n marked this conversation as resolved.
tests = [
"async-timeout",
"coverage~=4.5",
"pytest",
"pytest-django",
"pytest-asyncio",
"selenium",
]

[project.urls]
Documentation = "https://channels.readthedocs.io/"
Source = "http://github.com/django/channels"

[tool.setuptools]

[tool.setuptools.dynamic]
version = { attr = "channels.__version__" }

[tool.setuptools.packages.find]
include = [ "channels*" ]

[tool.flake8]
exclude = "venv/*,tox/*,docs/*,testproject/*,build/*"
max-line-length = 88
extend-ignore = "E203,W503"
per-file-ignores = "tests/sample_project/config/asgi.py:E402"

[tool.isort]
profile = "black"

[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
66 changes: 0 additions & 66 deletions setup.cfg

This file was deleted.

7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
[tox]
requires =
tox>=4.22
envlist =
py{310,311,312,313,314}-dj52
py{312,313,314}-dj60
py{312,313,314}-djmain
qa

[testenv]
extras = tests, daphne
extras = daphne
dependency_groups =
tests
commands =
pytest -v {posargs}
deps =
Expand All @@ -19,6 +23,7 @@ skip_install=true
deps =
black
flake8
flake8-pyproject

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for loading config for flak8 from pyproject.toml

isort
commands =
flake8 channels tests
Expand Down