Skip to content

Commit c16b3cc

Browse files
authored
Use PEP 735 Dependency Groups for testing (#4)
Several tools, like `uv` now support dependency groups to separate from other optional-dependencies. Adding the test requirements there. Ideally this would replace the values in [test] but seems like it's only supported in Python 3.13 +
1 parent b8a8133 commit c16b3cc

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
django-version:
3131
- "6.0"
3232
extras:
33-
- "test"
34-
- "test,sentry"
35-
- "test,redis"
33+
- "" # We try a run without any extras
34+
- "--extra sentry"
35+
- "--extra redis"
3636
services:
3737
redis:
3838
image: redis
@@ -47,9 +47,9 @@ jobs:
4747
- uses: actions/setup-python@v6
4848
with:
4949
python-version: ${{ matrix.python-version }}
50-
- run: python -m pip install .[${{ matrix.extras }}]
51-
- run: python -m pip install django~=${{ matrix.django-version }}.0
52-
- run: python -m pytest
50+
- name: Install uv
51+
uses: astral-sh/setup-uv@v7
52+
- run: uv run ${{ matrix.extras }} --with django~=${{ matrix.django-version }}.0 pytest
5353
- uses: codecov/codecov-action@v5
5454
with:
5555
token: ${{ secrets.CODECOV_TOKEN }}

pyproject.toml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ requires-python = ">=3.12"
3737
dependencies = ["apscheduler", "django>=6.0"]
3838

3939
[project.optional-dependencies]
40-
test = [
41-
"pytest",
42-
"pytest-cov",
43-
"pytest-django",
44-
]
4540
sentry = ["sentry-sdk"]
4641
redis = ["redis"]
4742

@@ -93,3 +88,13 @@ force-wrap-aliases = true
9388

9489
[tool.ruff.lint.pydocstyle]
9590
convention = "pep257"
91+
92+
[dependency-groups]
93+
dev = [
94+
{ include-group = "test" },
95+
]
96+
test = [
97+
"pytest",
98+
"pytest-cov",
99+
"pytest-django",
100+
]

0 commit comments

Comments
 (0)