Skip to content

Commit 484ce30

Browse files
committed
pyproject.toml: switch from extras to dependency groups
See https://packaging.python.org/en/latest/specifications/dependency-groups/ More suitable for internal stuff than extras which are exposed externally. Also moves all development dependency declarations from tox.ini to be in a single place, pyproject.toml.
1 parent 7c99f33 commit 484ce30

File tree

3 files changed

+28
-19
lines changed

3 files changed

+28
-19
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
- name: Install dependencies
5151
run: |
5252
python -m pip install --upgrade pip
53-
pip install tox==4.11.1
53+
pip install tox==4.26.0
5454
5555
- name: Run tox
5656
run: tox -e ${{ matrix.name }}

pyproject.toml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ classifiers = [
4040
dependencies = [
4141
"pytest>=7.0.0",
4242
]
43-
[project.optional-dependencies]
43+
[dependency-groups]
4444
docs = [
4545
"sphinx",
4646
"sphinx_rtd_theme",
@@ -49,6 +49,23 @@ testing = [
4949
"Django",
5050
"django-configurations>=2.0",
5151
]
52+
coverage = [
53+
"coverage[toml]",
54+
"coverage-enable-subprocess",
55+
]
56+
postgres = [
57+
"psycopg[binary]",
58+
]
59+
mysql = [
60+
"mysqlclient==2.1.0",
61+
]
62+
xdist = [
63+
"pytest-xdist",
64+
]
65+
linting = [
66+
"ruff==0.9.5",
67+
"mypy==1.15.0",
68+
]
5269
[project.urls]
5370
Documentation = "https://pytest-django.readthedocs.io/"
5471
Repository = "https://github.com/pytest-dev/pytest-django"

tox.ini

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,19 @@ envlist =
88
linting
99

1010
[testenv]
11-
extras = testing
11+
dependency_groups =
12+
testing
13+
coverage: coverage
14+
mysql: mysql
15+
postgres: postgres
16+
xdist: xdist
1217
deps =
1318
djmain: https://github.com/django/django/archive/main.tar.gz
1419
dj52: Django>=5.2a1,<6.0
1520
dj51: Django>=5.1,<5.2
1621
dj50: Django>=5.0,<5.1
1722
dj42: Django>=4.2,<4.3
18-
19-
mysql: mysqlclient==2.1.0
20-
21-
postgres: psycopg[binary]
22-
coverage: coverage[toml]
23-
coverage: coverage-enable-subprocess
24-
2523
pytestmin: pytest>=7.0,<7.1
26-
xdist: pytest-xdist>=1.15
2724

2825
setenv =
2926
mysql: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_mysql
@@ -46,26 +43,21 @@ commands =
4643
coverage: coverage xml
4744

4845
[testenv:linting]
49-
extras =
50-
deps =
51-
ruff==0.9.5
52-
mypy==1.15.0
46+
dependency_groups = linting
5347
commands =
5448
ruff check --diff {posargs:pytest_django pytest_django_test tests}
5549
ruff format --quiet --diff {posargs:pytest_django pytest_django_test tests}
5650
mypy {posargs:pytest_django pytest_django_test tests}
5751

5852
[testenv:doc8]
59-
extras =
6053
basepython = python3
6154
skip_install = true
55+
dependency_groups = docs
6256
deps =
63-
sphinx
6457
doc8
6558
commands =
6659
doc8 docs/
6760

6861
[testenv:docs]
69-
deps =
70-
extras = docs
62+
dependency_groups = docs
7163
commands = sphinx-build -n -W -b html -d docs/_build/doctrees docs docs/_build/html

0 commit comments

Comments
 (0)