Skip to content

Improve SPDX import by generating generic PURLs when missing - #2049

Closed
Monal-Reddy wants to merge 2 commits into
aboutcode-org:mainfrom
Monal-Reddy:fix-spdx-generic-purl
Closed

Monal-Reddy wants to merge 2 commits into
aboutcode-org:mainfrom
Monal-Reddy:fix-spdx-generic-purl

Conversation

@Monal-Reddy

Copy link
Copy Markdown
Contributor

Fixes #1914

This PR improves the load_sbom pipeline handling of SPDX SBOMs by generating a fallback pkg:generic PURL when an SPDX package does not provide an explicit PURL but does include a name and version.

This avoids classifying such packages as pkg:unknown, improving package typing and downstream reporting for SPDX-based Python SBOMs.

Tested locally using ScanCode.io with:

  • Python-3.13.9.tgz.spdx.json
  • load_sbom pipeline

Previously affected packages such as CPython, expat, libb2, and mpdecimal are now correctly represented as pkg:generic/*.

Signed-off-by: Monal-Reddy <monalreddy001@gmail.com>
@Monal-Reddy

Copy link
Copy Markdown
Contributor Author

For reference, here is the result after applying this fix locally.

Packages previously classified as pkg:unknown/* are now resolved as pkg:generic/* when loading the Python 3.13.9 SPDX SBOM via load_sbom.

Image
image

I found this an interesting area, if this looks good to you, i'd be happy to work on the subsequent issues as u have mentioned

@tdruez

tdruez commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Thanks for raising this. Fixed in #2369, which sets the generic type on SPDX packages without a PURL, the name and version already come from the SPDX fields. Closing in favor of it.

@tdruez tdruez closed this Nov 23, 2026
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.

Improve SPDX import from Python SBOMs

2 participants