feat: add support for pyproject.toml via uv, poetry & pdm#432
feat: add support for pyproject.toml via uv, poetry & pdm#432Strum355 wants to merge 1 commit intoguacsec:mainfrom
Conversation
ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan Review Summary by QodoAdd pyproject.toml support with uv, poetry, and pdm lock file providers
WalkthroughsDescription• Add new Python provider supporting pyproject.toml with uv, poetry, and pdm lock files • Parse direct dependencies from PEP 621 project.dependencies or tool.poetry.dependencies • Support dependency tree building with transitive dependency resolution • Implement PEP 503 package name canonicalization for matching manifest and lock file names • Support exhortignore and trustify-da-ignore markers for excluding dependencies • Handle PEP 508 features including extras and environment markers • Add comprehensive test coverage with multiple lock file scenarios • Minor code formatting fixes in python_pip.js provider Diagramflowchart LR
A["pyproject.toml"] --> B["Lock File Detection"]
B --> C["poetry.lock"]
B --> D["pdm.lock"]
B --> E["uv.lock"]
C --> F["Parse Dependencies"]
D --> F
E --> F
F --> G["Build Dependency Tree"]
G --> H["Apply Ignore Markers"]
H --> I["Generate SBOM"]
File Changes2. src/providers/python_pyproject.js
|
Code Review by Qodo
1. Lockfile gating inconsistent
|
|
|
||
| const IGNORE_MARKERS = ['exhortignore', 'trustify-da-ignore'] | ||
|
|
||
| const DEFAULT_ROOT_NAME = 'default-pip-root' |
There was a problem hiding this comment.
This doesnt seem to ever be changed, its a relic copied from the pip provider. Pyproject.toml has project specific metadata that we could probably extract a more meaningful root name from.
There was a problem hiding this comment.
I agree, [project] metadata for name and version are required in the toml file so it should be used instead of this default.
this is something to implement also in the Java side
Verification Report for TC-3850 (Revised)
Acceptance Criteria Details
Architecture Comparison with Java Counterpart (PR #358)This PR was cross-referenced against the Java client's pyproject.toml implementation (guacsec/trustify-da-java-client#358). Resolution strategy — justified divergence from task spec: The Jira task instructs to "reuse
The The Java implementation takes a different path by converting pyproject.toml deps to a temp requirements.txt and piping through pip — this works but doesn't leverage the lock file. Findings1. Lock file validation gap (WARN)
2. Code duplication (WARN)
3. Silent dependency loss (WARN)
4. README.md not updated (FAIL)
5. Missing Jira traceability (FAIL)
Overall: FAILCore implementation is solid and the lock-file-based architecture is a sound design choice. Two blocking issues remain: missing README.md updates and missing Jira traceability. Three non-blocking recommendations for lock file validation, code deduplication, and silent dependency handling. This comment was AI-generated by sdlc-workflow/verify-pr v0.5.0. |
ruromero
left a comment
There was a problem hiding this comment.
As suggested by the review tool.
The readme changes are missing and we have to align the Java and Javascript implementations.
I suggest that the best approach is to leverage the tooling to resolve the dependencies and make sure the lock file is aligned, as we do in the Java implementation.
The poetry, uv and pdm lockfiles were added but if we rely on the binary files to resolve the dependencies and ensure the lock file sync we will have to implement the support individually. Let's create separate tasks for uv and poetry.
Description
Adds support for pyproject.toml files, using lockfiles from uv, poetry or pdm.
Implements: TC-3850
Checklist