Skip to content

fix: install #python template pytest via dependency-group - #945

Merged
c-vigo merged 1 commit into
release/0.5.0from
bugfix/944-python-template-dep-group
Jul 8, 2026
Merged

c-vigo merged 1 commit into
release/0.5.0from
bugfix/944-python-template-dep-group

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Problem

templates/python/pyproject.toml declares dev tooling as an extra ([project.optional-dependencies].dev), but the scaffold's managed sync is groups-only by design (sync *args="--all-groups"). So a project scaffolded from nix flake init -t ...#python that follows the template README ("Then just sync and just test") can't find pytest — just test fails with Failed to spawn: pytest. Not caught by CI (no test inits the template and runs its test flow).

Fix

Move pytest/pytest-cov to [dependency-groups].dev (PEP 735). Aligns the template with the scaffold's 'extras are opt-in' contract; the documented just sync && just test flow now works.

Verification

Scaffolded a copy of the template: uv sync --all-groups installs pytest==9.1.1 / pytest-cov==7.1.0; uv run pytest → 1 passed. Full prek run --all-files green.

Notes

  • Template/config change, no test to break (test_just_test_recipe covers only the language-neutral base) — TDD skipped per repo policy for template/config.
  • Independent of the smoke-test fix (devcontainer-smoke-test#206); the smoke-test does not use the template.

Refs: #944

The #python starter declared pytest/pytest-cov as a
[project.optional-dependencies] extra, but the scaffold's managed sync is
groups-only (uv sync --all-groups; extras opt-in). A project scaffolded
from the template and following its README (just sync && just test) thus
could not find pytest. Move them to [dependency-groups].dev so the default
sync installs them and uv run pytest works.

Refs: #944
@c-vigo
c-vigo merged commit 6becb11 into release/0.5.0 Jul 8, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/944-python-template-dep-group branch July 8, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant