Skip to content

Commit 9c2a34f

Browse files
committed
docs: document _getDependencyData() directory parameter semantics
Add JSDoc to Base_pyproject._getDependencyData() explaining that manifestDir is the project directory and workspaceDir is the lock file directory. Documents when each should be used by lock-file-based vs non-lock-file providers. Implements TC-4102 Assisted-by: Claude Code
1 parent dcb2120 commit 9c2a34f

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/providers/base_pyproject.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,17 @@ export default class Base_pyproject {
168168

169169
/**
170170
* Resolve dependencies using the tool-specific command and parser.
171+
*
172+
* Called by {@link _createSbom} with two directory parameters:
173+
* - `manifestDir` is where `pyproject.toml` lives (the project directory).
174+
* - `workspaceDir` is where the lock file lives, resolved by `_findLockFileDir()`.
175+
* Falls back to `manifestDir` when no lock file is found.
176+
*
177+
* Lock-file-based providers (uv, poetry) use `workspaceDir` for lock-file
178+
* operations. Non-lock-file providers (pip) must use `manifestDir` because
179+
* commands like `pip install .` run relative to the project directory.
180+
* Subclasses that ignore `workspaceDir` should prefix it with `_`.
181+
*
171182
* @param {string} manifestDir - directory containing the target pyproject.toml
172183
* @param {string} workspaceDir - workspace root (where the lock file lives), or same as manifestDir for standalone projects
173184
* @param {object} parsed - parsed pyproject.toml

0 commit comments

Comments
 (0)