Skip to content

Commit 3258386

Browse files
committed
keep tests under [dependency-groups] and update tox and docs accordingly.
1 parent 54489b3 commit 3258386

4 files changed

Lines changed: 15 additions & 18 deletions

File tree

CONTRIBUTING.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,10 @@ Make sure the tests pass:
2525

2626
.. code-block:: sh
2727
28-
python -m pip install -e .[tests,daphne]
28+
python -m pip install -e . --group tests
29+
python -m pip install -e ".[daphne]"
2930
pytest
3031
31-
.. note::
32-
If you're using ``zsh`` for your shell, the above command will fail with a
33-
``zsh: no matches found: .[tests]`` error.
34-
To fix this use ``noglob``::
35-
36-
noglob python -m pip install -e .[tests]
37-
3832
Make your change. Add tests for your change. Make the tests pass:
3933

4034
.. code-block:: sh

docs/contributing.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ your environment:
7474
.. code-block:: sh
7575
7676
cd channels/
77-
python -m pip install -e .[tests]
77+
python -m pip install -e . --group tests
7878
79-
Note the ``[tests]`` section there; that tells ``pip`` that you want to install
80-
the ``tests`` extra, which will bring in testing dependencies like
79+
Note the ``--group tests`` section there; that tells ``pip`` that you want to install
80+
the ``tests`` dependency group from ``pyproject.toml``, which will bring in testing dependencies like
8181
``pytest-django``.
8282

8383
Then, you can run the tests:

pyproject.toml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ dependencies = [
3434
"asgiref>=3.9.0,<4",
3535
]
3636

37+
38+
[project.optional-dependencies]
39+
daphne = [
40+
"daphne>=4.0.0",
41+
]
42+
types = [
43+
"types-channels",
44+
]
45+
3746
[dependency-groups]
3847
tests = [
3948
"async-timeout",
@@ -43,12 +52,6 @@ tests = [
4352
"pytest-asyncio",
4453
"selenium",
4554
]
46-
daphne = [
47-
"daphne>=4.0.0",
48-
]
49-
types = [
50-
"types-channels",
51-
]
5255

5356
[project.urls]
5457
Documentation = "https://channels.readthedocs.io/"

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ envlist =
88
qa
99

1010
[testenv]
11+
extras = daphne
1112
dependency_groups =
1213
tests
13-
daphne
1414
commands =
1515
pytest -v {posargs}
1616
deps =

0 commit comments

Comments
 (0)