Skip to content

fix: #python template declares pytest as an extra, not a dependency-group (breaks just test) #944

Closed

Description

@c-vigo

Problem

templates/python/pyproject.toml (the opt-in Python starter, #930) declares dev tooling as an extra:

[project.optional-dependencies]
dev = ["pytest==9.1.1", "pytest-cov==7.1.0"]

But the scaffold's managed sync recipe is groups-only by design (sync *args="--all-groups"; extras opt-in). So a project scaffolded from nix flake init -t ...#python that follows the template README ("Then just sync and just test") gets just sync → uv sync --all-groups, which does not install the pytest extra → just test → uv run pytest fails with Failed to spawn: pytest.

Not currently caught by CI: no test inits the template and runs its just sync && just test (test_just_test_recipe covers only the language-neutral base). Surfaced downstream via the smoke-test (#943, devcontainer-smoke-test#205).

Fix

Move pytest/pytest-cov to [dependency-groups].dev (PEP 735) so the default groups-only just sync installs them and uv run pytest works. Aligns the template with the scaffold's 'extras are opt-in' contract.

Refs: #943

Activity

  1. c-vigo commented on Jul 9, 2026

    @c-vigo
    ContributorAuthor

    Fixed by #945 (merged to release/0.5.0). Moved pytest/pytest-cov to [dependency-groups].dev in templates/python/pyproject.toml; verified a scaffolded copy runs uv sync --all-groups + uv run pytest green. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions