Repository navigation
fix: install #python template pytest via dependency-group - #945
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
templates/python/pyproject.tomldeclares dev tooling as an extra ([project.optional-dependencies].dev), but the scaffold's managedsyncis groups-only by design (sync *args="--all-groups"). So a project scaffolded fromnix flake init -t ...#pythonthat follows the template README ("Thenjust syncandjust test") can't find pytest —just testfails withFailed to spawn: pytest. Not caught by CI (no test inits the template and runs its test flow).Fix
Move
pytest/pytest-covto[dependency-groups].dev(PEP 735). Aligns the template with the scaffold's 'extras are opt-in' contract; the documentedjust sync && just testflow now works.Verification
Scaffolded a copy of the template:
uv sync --all-groupsinstalls pytest==9.1.1 / pytest-cov==7.1.0;uv run pytest→ 1 passed. Fullprek run --all-filesgreen.Notes
test_just_test_recipecovers only the language-neutral base) — TDD skipped per repo policy for template/config.Refs: #944