Skip to content

Commit

Permalink
chore: enable repo finder for sboms
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Selwyn-Smith <[email protected]>
  • Loading branch information
benmss committed Sep 21, 2023
1 parent 7e4e98a commit a8ccd34
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/macaron/dependency_analyzer/dependency_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,21 @@ def resolve_dependencies(main_ctx: Any, sbom_path: str) -> dict[str, DependencyI
dict[str, DependencyInfo]
A dictionary where artifacts are grouped based on ``artifactId:groupId``.
"""
deps_resolved: dict[str, DependencyInfo] = {}

if sbom_path:
logger.info("Getting the dependencies from the SBOM defined at %s.", sbom_path)
# Import here to avoid circular dependency
# pylint: disable=import-outside-toplevel, cyclic-import
from macaron.dependency_analyzer.cyclonedx import get_deps_from_sbom

return get_deps_from_sbom(sbom_path)
deps_resolved = get_deps_from_sbom(sbom_path)

deps_resolved: dict[str, DependencyInfo] = {}
# Use repo finder to find more repositories to analyze.
if defaults.getboolean("repofinder", "find_repos"):
DependencyAnalyzer._resolve_more_dependencies(deps_resolved)

return deps_resolved

build_tools = main_ctx.dynamic_data["build_spec"]["tools"]
if not build_tools:
Expand Down

0 comments on commit a8ccd34

Please sign in to comment.