Skip to content

Import corrected python-pyproject.md rule: dev deps belong in [dependency-groups], not [project.optional-dependencies] #44

Description

@leynos

Summary

Import the corrected python-pyproject.md agent rule from the downstream cuprum copy. The current template/.rules/python-pyproject.md gives incorrect guidance on where development dependencies belong: its "Optional and Development Dependencies" section places dev tooling (pytest, linters, etc.) under [project.optional-dependencies] and references a non-existent uv sync --include dev invocation.

Modern uv uses PEP 735 [dependency-groups] for development-only dependencies, and installs the dev group automatically by default. The rule file should teach that distinction.

What changed downstream

The fix landed in cuprum via leynos/cuprum#222 (file .rules/python-pyproject.md). It rewrites the dependency section to differentiate three fields:

Field Installed for Use for
project.dependencies Every consumer Required runtime libraries the shipped code imports
project.optional-dependencies End users who opt into an extra Optional runtime features (package[extra])
dependency-groups (PEP 735) Local development only Test, lint, type-check, docs tooling — never published

Key corrections:

  • Development tooling belongs in [dependency-groups], not [project.optional-dependencies].
  • uv run / uv sync install the dev group by default; documents --no-dev / --no-default-groups / --group / [tool.uv].default-groups.
  • [project.optional-dependencies] is reserved for opt-in runtime features (extras), requested via package[extra].
  • The Section 7 worked example and Section 9 summary were updated to match, and the uv dependencies guide (https://docs.astral.sh/uv/concepts/projects/dependencies/) added as a citation.

Requested change

  • Update template/.rules/python-pyproject.md to match the corrected cuprum copy (adjusting any Copier/Jinja templating as needed — the cuprum copy is plain Markdown).
  • Verify it passes the template's markdownlint config (MD060 wants spaced table pipes; MD013 prose limit is 80 cols, tables/code exempt) and the Oxford-spelling typos gate.
  • Confirm no other template rule file still points dev dependencies at [project.optional-dependencies].

Context

cuprum adopts this template's rule set (see ADR-002 / ADR-003 in this repo), so the template is the upstream source of truth for these shared rules; the correction should flow back here to reach every generated project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions