Flag local Python packages in SBOM metadata (OSS-1389)#17
Merged
Conversation
Monorepos declare internal packages as editable path or workspace dependencies (uv [tool.uv.sources], poetry path deps). These are the repo's own code, never published to a registry, so the scanner warns on every one when it can't find them upstream (OSS-1389). Detect them by parsing the local-source tables in pyproject.toml and mark matching pypi components with metadata.local=true. The flag rides in component metadata so it round-trips through the OSSBOM the platform parses from --local output; the platform filters on it. Names are compared PEP 503 canonically so casing/separator differences don't matter. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VWy9UuisvAKvwc8fLJjgCR
andyossprey
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change adds support for identifying and flagging locally-defined Python packages in the generated SBOM. Packages declared as local sources (via uv's
path/workspacesources or poetry's path dependencies) are now marked with metadata so the platform can filter them before scanning, preventing spurious NOT_FOUND warnings for internal code that is never published.Key Changes
New
local.gomodule: Implements package name canonicalization (PEP 503 compliant) and parsing ofpyproject.tomlfiles to extract locally-declared packages from both uv and poetry configurationscanonicalPackageName(): Normalizes package names by lowercasing and converting separators (-,_,.) to dashesfindLocalPackageNames(): Walks the filesystem to find allpyproject.tomlfiles and collects local package namescollectLocalNames(): Parses a single manifest and identifies local packagesUpdated
syft.go:Localboolean field to thePackagestruct with documentationCatalog()functionmarkLocalPackages()to match catalogued packages against locally-declared names using canonical comparisonUpdated
scan.go:"local": trueflag for locally-defined packagesComprehensive test coverage (
local_test.go):Implementation Details
Localflag only applies to pypi packages; other ecosystems are unaffectedhttps://claude.ai/code/session_01VWy9UuisvAKvwc8fLJjgCR