From e7c68510430d115e488ce257f257c9e7d11c06d1 Mon Sep 17 00:00:00 2001 From: Paul Traylor Date: Thu, 11 Dec 2025 20:48:15 +0900 Subject: [PATCH 1/3] Use PEP 735 Dependency Groups for testing 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 + --- pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 183802e..5877d95 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,3 +93,10 @@ force-wrap-aliases = true [tool.ruff.lint.pydocstyle] convention = "pep257" + +[dependency-groups] +dev = [ + "pytest", + "pytest-cov", + "pytest-django", +] From ad328d7e0b81e178d31bb8d76e70c328cda8350f Mon Sep 17 00:00:00 2001 From: Paul Traylor Date: Wed, 17 Dec 2025 17:37:39 +0900 Subject: [PATCH 2/3] Use test dependency-group We let the dev group include test by default, and move the test group from optional-dependencies to dependency-groups to have a single source of truth. --- pyproject.toml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5877d95..12864f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,11 +37,6 @@ requires-python = ">=3.12" dependencies = ["apscheduler", "django>=6.0"] [project.optional-dependencies] -test = [ - "pytest", - "pytest-cov", - "pytest-django", -] sentry = ["sentry-sdk"] redis = ["redis"] @@ -96,6 +91,9 @@ convention = "pep257" [dependency-groups] dev = [ + { include-group = "test" }, +] +test = [ "pytest", "pytest-cov", "pytest-django", From 0351f863554f7adb152d36f57a229e8ecb8d4c64 Mon Sep 17 00:00:00 2001 From: Paul Traylor Date: Wed, 17 Dec 2025 17:44:24 +0900 Subject: [PATCH 3/3] use 'uv run pytest' for CI Instead of our $extras var be a list, we will write it as the combination of --extra ? and no extra flags for uv. Then we can skip the two separate install steps, and run uv using the --with and $extras flags. uv build/publish does not have the same kind of check as `twine check` so that has not been updated yet. --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1736cb3..2acf200 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,9 +30,9 @@ jobs: django-version: - "6.0" extras: - - "test" - - "test,sentry" - - "test,redis" + - "" # We try a run without any extras + - "--extra sentry" + - "--extra redis" services: redis: image: redis @@ -47,9 +47,9 @@ jobs: - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - - run: python -m pip install .[${{ matrix.extras }}] - - run: python -m pip install django~=${{ matrix.django-version }}.0 - - run: python -m pytest + - name: Install uv + uses: astral-sh/setup-uv@v7 + - run: uv run ${{ matrix.extras }} --with django~=${{ matrix.django-version }}.0 pytest - uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }}