Skip to content

feat: mark dev-dependencies component.scope as "excluded" #675

Open

Description

@jkowalleck

Is your feature request related to a problem? Please describe.

Per CycloneDX specification, the components' scope means (see docs)

  • "required": The component is required for runtime
  • "optional": The component is optional at runtime. Optional components are components that are not capable of being called due to them not be installed or otherwise accessible by any means. Components that are installed but due to configuration or other restrictions are prohibited from being called must be scoped as 'required'.
  • "excluded": Components that are excluded provide the ability to document component usage for test and other non-runtime purposes. Excluded components are not reachable within a call graph at runtime.

Current implementation does not set any scope, meaning the fallback to "required".
for dev-dependencies this would be wrong.

Describe the solution you'd like

mark all components, that are dev-dependencies only, as "excluded" in the resulting SBOM.

Describe alternatives you've considered

none

Additional context

for poetry

poetry knowns the "dev" group/category - things that are in there only (not in any other) are dev-dependencies

for pipenv

pipenv knowns a group/category called "dev-packages" - things that are in there only (not in any other) are dev-dependencies

for pyproject.toml

pyproject knows optional-dependency groups. see also PEP735 (draft)
there is no accepted PEP for that matter (or is there?), but commonly, people use "dev" or
"devel", "development" group to tell development-dependencies. - things that are in there, but not in any other, are dev-dependencies
Since there is no consensus here, the pyproject SHOULD have no effect on the component.scope, for now

Activity

  1. changed the title [-]feat: mark poetry dev-dependencies `component.scope` as "escluded[/-] [+]feat: mark Poetry's dev-dependencies `component.scope` as "escluded[/+] on Feb 8, 2024
  2. changed the title [-]feat: mark Poetry's dev-dependencies `component.scope` as "escluded[/-] [+]feat: mark Poetry's dev-dependencies `component.scope` as "excluded"[/+] on Mar 14, 2024
  3. changed the title [-]feat: mark Poetry's dev-dependencies `component.scope` as "excluded"[/-] [+]feat: mark dev-dependencies `component.scope` as "excluded"[/+] on Jun 3, 2024
  4. dedsec-terminal commented on Oct 14, 2026

    @dedsec-terminal

    Hi @jkowalleck,

    I have opened PR #1120 addressing this issue for both Poetry and Pipenv parsers per the specification:

    • Poetry: Sorted group parsing to guarantee runtime dependencies retain default scope (\scope = None). Components residing exclusively in dev groups (\ ool.poetry.group.dev, \ ool.poetry.dev-dependencies) are assigned \ComponentScope.EXCLUDED.
    • Pipenv: Pre-scans lockfile categories so dependencies shared across \develop\ and default/custom categories maintain runtime scope, while develop-only packages receive \ComponentScope.EXCLUDED.
    • pyproject.toml: Left untouched as requested pending standardized PEP consensus.
    • Testing: Added unit tests in \ ests/unit/test_poetry.py\ and \ ests/unit/test_pipenv.py\ covering dev-only exclusion, shared dependency runtime retention, and category isolation (all tests pass, DCO signed).

    Looking forward to your review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions