feat(supply_chain): scan tool-specific dependency tables in pyproject.toml (Poetry, PDM, Hatch, uv)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 17.9k
- Forks
- 1.5k
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 66
Description
Background
PR #95 fixed false-positive SC5/SC6 findings on pyproject.toml metadata keys by switching from the requirements-regex parser to tomllib. It reads only the three PEP 621/517 standard dependency arrays:
[project].dependencies[project.optional-dependencies][build-system].requires
Gap
Projects using tool-specific build backends (Poetry, PDM, Hatch, uv) declare dependencies in non-standard tables that are currently not scanned. Previously these lines caused false positives; now they cause false negatives (real dependencies not checked for typosquatting/abandonment).
Tables to add
| Tool | Table(s) |
|---|---|
| Poetry | [tool.poetry.dependencies], [tool.poetry.dev-dependencies], [tool.poetry.group.*.dependencies] |
| PDM | [tool.pdm.dev-dependencies] |
| Hatch | [tool.hatch.envs.*.dependencies] |
| uv | [tool.uv.dev-dependencies] |
Implementation notes
- Extend
_extract_packages_from_pyproject()to walkdata.get("tool", {})for known keys - Poetry group dependencies use a nested
{version = "..."}dict format rather than PEP 508 strings — needs separate handling - Add tests for each tool format
Acceptance criteria
- All four tool-specific formats parsed correctly
- Malformed / unexpected structure in tool tables does not crash the analyzer
- False-positive regression tests updated (tool-table keys must not produce SC5/SC6 on metadata fields)
- New tests for each tool format
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating _extract_packages_from_pyproject() and the existing tests around pyproject.toml dependency extraction. Trace how tomllib data is handled, then add coverage for the listed Poetry, PDM, Hatch, and uv tables, including Poetry’s nested group format and malformed structures. Done means all formats are scanned without crashes and the metadata false-positive regressions remain covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- security, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100