Skip to content

Teach PEP 735 development dependency groups (#44) - #45

Draft
lodyai[bot] wants to merge 1 commit into
mainfrom
issue-44-import-corrected-python-pyproject-md-rule-dev-deps-belong-in-dependency-groups-not-project-optional-dependencies
Draft

Teach PEP 735 development dependency groups (#44)#45
lodyai[bot] wants to merge 1 commit into
mainfrom
issue-44-import-corrected-python-pyproject-md-rule-dev-deps-belong-in-dependency-groups-not-project-optional-dependencies

Conversation

@lodyai

@lodyai lodyai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Summary

This branch imports cuprum's corrected pyproject.toml rule so development
tooling uses PEP 735 [dependency-groups], while runtime extras remain in
[project.optional-dependencies].

Closes #44.

Review walkthrough

Validation

  • markdownlint-cli2 --config template/.markdownlint-cli2.jsonc template/.rules/python-pyproject.md: passed (0 errors)
  • uv tool run typos@1.48.0 --config template/typos.toml --force-exclude template/.rules/python-pyproject.md: passed
  • coderabbit review --agent: passed (0 findings)
  • Verified no other template rule directs development dependencies to [project.optional-dependencies].

References

Summary by Sourcery

Document PEP 735 dependency groups in the Python pyproject rule and clearly separate runtime, optional feature, and development-only dependencies for uv-based projects.

Enhancements:

  • Clarify guidance on choosing between project.dependencies, project.optional-dependencies, and dependency-groups, including a reference table and rule-of-thumb for field selection.
  • Describe uv's default handling of the dev dependency group and configuration options for default and nested groups, conflicts, and sync behavior.
  • Update example pyproject.toml to move development tooling into dependency-groups and reserve project.optional-dependencies for opt-in runtime features.
  • Refresh and reindex documentation references and footnotes to align with updated Astral uv dependency and config docs.

@sourcery-ai

sourcery-ai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Reviewer's Guide

Updates the python-pyproject template rule to clearly separate runtime dependencies, optional runtime extras, and PEP 735 development dependency groups using uv, and aligns examples and references with this model.

File-Level Changes

Change Details Files
Rewrite dependency section to teach PEP 735 development dependency groups and distinguish them from runtime dependencies and extras.
  • Rename and expand the section on optional/development dependencies into a "Runtime vs. development dependencies" section with a field-selection table for project.dependencies, project.optional-dependencies, and dependency-groups.
  • Add detailed subsections and TOML examples for required runtime dependencies, optional runtime features, and development-time dependency groups, including uv CLI usage and default dev-group behavior.
  • Clarify that development tooling must live in dependency-groups (PEP 735) rather than project.optional-dependencies, and document uv group resolution, default-groups configuration, and conflicts handling.
template/.rules/python-pyproject.md
Adjust tutorial examples to move dev tooling into dependency-groups and keep project.optional-dependencies for runtime extras only.
  • Update the worked pyproject.toml example to define a runtime extra (fast) under project.optional-dependencies and move dev/docs tooling into dependency-groups.
  • Revise the summary bullets to explicitly differentiate runtime dependencies, optional runtime features, and development-only dependency groups, including the default installation of the dev group.
  • Update the closing guidance checklist to mention dependency-groups for development-only tooling alongside project.optional-dependencies for runtime features.
template/.rules/python-pyproject.md
Keep documentation formatting and references consistent with the new content and updated Astral docs links.
  • Reflow long prose lines to maintain markdown readability without semantic changes.
  • Update footnote indices and URLs to point to more specific Astral uv docs pages for dependencies and configuration, and adjust in-text citations accordingly.
  • Fix minor comment and narrative text to align with the new dependency model and terminology (e.g., clarifying runtime vs development usage).
template/.rules/python-pyproject.md

Assessment against linked issues

Issue Objective Addressed Explanation
#44 Update template/.rules/python-pyproject.md to match the corrected cuprum rule, teaching that development tooling belongs in [dependency-groups] (PEP 735) and that [project.optional-dependencies] is for opt-in runtime features, including examples and updated sections/summary.
#44 Ensure the updated template/.rules/python-pyproject.md complies with the repository’s markdownlint configuration and typos (Oxford spelling) checks.
#44 Verify that no other template rule files still instruct users to put development dependencies under [project.optional-dependencies].

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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.

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

0 participants