Skip to content

Enhancement: expand PEP 735 {include-group = "..."} entries in [dependency-groups] #548

Closed

Description

@vibgrate-team

Context

src/core-open/scanners/python-scanner.ts reads [dependency-groups] requirement strings as development rows, but skips {include-group = "..."} entries without expanding them (gap 10 in docs/sbom-dependency-scope.md). Each group's own array is still read, so this is only visible when a group includes a group that is not otherwise scanned, or when the inclusion chain matters for precedence. Expanding includes makes the scanner match what uv sync --group and pip install --group actually install.

What to do

  • Resolve include-group references within the same pyproject.toml, normalising group names per PEP 735 (lowercase, runs of -, _, . collapsed).
  • Detect include cycles and stop with a clear warning instead of looping.
  • Keep the existing section precedence (production and optional rules unchanged).
  • Update gap 10 in docs/sbom-dependency-scope.md.

Acceptance

  • A group that includes another group yields rows for the included group's requirements.
  • A cycle (a includes b, b includes a) terminates with one warning.
  • Name normalisation (Dev_Tools vs dev-tools) is covered by a test.

Activity

  1. added
    enhancement
    on Nov 2, 2026
  2. vibgrate-team commented on Nov 2, 2026

    @vibgrate-team
    ContributorAuthor

    Confirmed: python-scanner.ts reads [dependency-groups] via tomlTableBody(content, 'dependency-groups') and skips {include-group = "..."} entries (see the comments near lines 415 and 566). A clean approach is to first build a map of normalised group name to its raw entries, then expand with a recursive resolver that carries a visiting set: if a name is already in the set, emit one warning and stop. PEP 735 normalisation is name.toLowerCase().replace(/[-_.]+/g, '-'). Because every group's own array is already read, the visible change is mostly for chains and precedence, so a test where an included group has a requirement not listed anywhere else is the clearest proof.

  3. added a commit that references this issue on Nov 5, 2026
    a33b39f
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions