Skip to content

[IDEA] feat: library mode #1041

Open
Open

Description

@jkowalleck

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

if i build a SBOM for a library, i do not want to have non-bundled component listed as if they were concrete.
These dependencies are extraneous/"external" and the version of them is not clear - it is resolved on install-time .
Also, transitive dependencies of those are not clear until install-time.

This should be reflected in the SBOM.

Describe the solution you'd like

Spec: CycloneDX/specification#321

add a way to have

UX

to be discussed - see #1041 (comment)

option to exisitng subcomamnds

option could be called (list of ideas)

  • --library-mode
  • --mark-extraneous/--mark-externals
  • add your idea in the comments

new option MUST imply --omit dev

new option MUST be disabled bu default
new option MUST be marked as experimental in help page
new option might set `--mc-type=library'

Describe alternatives you've considered

  • instead of adding an option to existing sub-commands, we might add a specific sub command. -- to be discussed.
  • we could make it, so that the existing option `--mc-type=library' causes this behavior by default, but that would be a breaking change

Additional context

for libraries, non-bundled components are "external" - this is discussed in specification#321

pyrproject.toml knows the concept of

the library-moed SBOM genertated by the tool might be merged with an extra SBOM to create an entire SBOM for PEP770

Contribution

  • I am willing to provide an implementation
  • I will wait until somebody else implements it

Activity

  1. jkowalleck commented on Apr 15, 2026

    @jkowalleck
    MemberAuthor

    see discussion #1040 and others

  2. jkowalleck commented on Apr 15, 2026

    @jkowalleck
    MemberAuthor

    still undecided hot the user experience should look like

    proposed:

    enrich the currently existing subcomamnds

    cyclonedx-py environment --library-mode --pproject ... # this just makes no sense: analyzing an env is not needed to get the unspecific component declarations in an package manifest
    
    cyclonedx-py requireemnts --library-mode --pproject pyproject.toml ... # shure, why not
    cyclonedx-py pipenv       --library-mode --pproject pyproject.toml ... # shure, why not
    cyclonedx-py poetry       --library-mode --pproject pyproject.toml ... # shure, why not

    alternatives

    dedicated subcommand

    • manifest ...
      cyclonedx-py manifest --pproject pyproject.toml ...
      • ❗ this might require implementation of alternative pyproject manifest standards for uv, poetry2 etc
        ...
    • wheel
      • cyclonedx-py wheel ... something.wheel
      • ❗ analyzes the wheel description and searches for runtime depednencies

    ❗ adding a dedicated subcommand would probably the most non-breaking UX that gives us the most freedom - implementation wise and on the UX side

  3. changed the title [-][FEATURE] library mode[/-] [+][IDEA] feat: library mode[/+] on Apr 15, 2026
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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions