sbom4python icon indicating copy to clipboard operation
sbom4python copied to clipboard

Feature request: Including optional feature's dependencies

Open ogbautista opened this issue 1 year ago • 3 comments

I recently noticed a case where an SBOM that included twisted as a dependency was not listed as a dependency. After careful review, I found that twisted was installed as twisted[tls] and, as a consequence, additional sub-dependencies are installed. I unsuccessfully tried generating an sbom for twisted[tls]. As a workaround, I had to generate SBOMs for the additional sub-dependencies and merge them. It would be great if these can be added automatically by sbom4python given the correct command line input.

ogbautista avatar Apr 23 '24 23:04 ogbautista

@ogbautista Thanks for raising this. I don't anything special for optional dependencies so I need to look at how optional dependencies are handled within the ecosystem.

anthonyharrison avatar Apr 24 '24 09:04 anthonyharrison

@ogbautista I have now looked at how optional dependencies are handled.

In separate python virtual machines, I pip installed twisted and twisted[tls]. Whilst the optional dependencies are installed, they are not referenced in the metadata associated with twisted module and associated packages, and are therefore not included in the SBOM. I will look into offering a new option to create an SBOM for all of the installed python modules (within a virtual machine) instead of just a single module.

anthonyharrison avatar Apr 26 '24 16:04 anthonyharrison

That will be awesome!

ogbautista avatar Apr 26 '24 17:04 ogbautista

@ogbautista Version 0.11.0 now has a --system option which will report all installed Python modules in a system.

anthonyharrison avatar Aug 12 '24 07:08 anthonyharrison