refactor: use pip --dry-run --report for pyproject.toml#406
refactor: use pip --dry-run --report for pyproject.toml#406ruromero merged 6 commits intoguacsec:mainfrom
Conversation
Review Summary by QodoRefactor pyproject.toml resolution using pip --dry-run --report
WalkthroughsDescription• Replace venv + pip install/freeze/show chain with single pip install --dry-run --report command • Parse pip report JSON to build full dependency tree directly, eliminating temporary files • Add comprehensive tests for pip report parsing, extras filtering, and name canonicalization • Support environment variable override for pip report output in testing Diagramflowchart LR
A["pyproject.toml"] -->|"pip install --dry-run --report"| B["pip_report.json"]
B -->|"parsePipReport"| C["PipReportData"]
C -->|"addDependencyTree"| D["SBOM with full dependency tree"]
E["Environment Variable"] -->|"TRUSTIFY_DA_PIP_REPORT"| B
File Changes1. src/main/java/io/github/guacsec/trustifyda/providers/PythonProvider.java
|
Code Review by Qodo
|
Verification Report for TC-4087 (commit 4803939)
Overall: WARNCommit messages do not reference TC-4087. All CI checks pass and review feedback is addressed. This comment was AI-generated by sdlc-workflow/verify-pr v0.5.11. |
f81ae55 to
baa8908
Compare
…dency resolution Replace the venv + pip install/freeze/show chain with a single pip install --dry-run --ignore-installed --report command that outputs the full dependency tree as JSON. This eliminates temporary file creation, virtual environment setup, and multiple subprocess calls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…Provider PythonProvider now only holds shared utilities (toPurl, handleIgnoredDependencies, containsIgnorePattern, root component defaults). The venv-based provideStack/ provideComponent, getPythonController, getExecutable, and related methods are moved to PythonPipProvider — the only consumer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use runProcessGetFullOutput instead of runProcessGetOutput so that stdout/stderr are drained in parallel (avoiding deadlock) and a non-zero exit code throws a clear error instead of silently returning stderr. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Poetry-style [tool.poetry.dependencies] in pyproject.toml is not supported; provideStack/provideComponent now fail fast with a clear error message. Also use manifest.toAbsolutePath().getParent() to prevent null working directory, and log a warning when the pip report has packages but no root entry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Poetry dependencies are explicitly rejected; remove the remaining Poetry-specific fallbacks for name/version/license, the Poetry dependency parsing and version-conversion methods, and all corresponding tests to avoid false expectations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
Summary
pip install --dry-run --ignore-installed --reportcommand for pyproject.toml dependency resolutionJira
TC-4087
Test plan
🤖 Generated with Claude Code