import Base_pyproject from './base_pyproject.js'; export default class Python_poetry extends Base_pyproject { /** * Poetry has no native workspace/monorepo support (python-poetry/poetry#2270). * Each poetry project is treated independently — no lock file walk-up. * Running `poetry show` from a parent directory returns the parent's deps, not * the sub-package's, so walk-up would produce incorrect SBOMs. * @param {string} manifestDir * @param {Object} [opts={}] * @returns {string|null} * @protected */ protected _findLockFileDir(manifestDir: string, opts?: Object): string | null; /** @returns {string} */ _lockFileName(): string; /** @returns {string} */ _cmdName(): string; _verifyPoetryAccessible(poetryBin: any): void; /** * @param {string} manifestDir * @param {string} _workspaceDir - unused (poetry has no workspace support) * @param {object} parsed - parsed pyproject.toml * @param {Object} opts * @returns {Promise<{directDeps: string[], graph: Map}>} */ _getDependencyData(manifestDir: string, _workspaceDir: string, parsed: object, opts: Object): Promise<{ directDeps: string[]; graph: Map; }>; /** * Get poetry show --tree output. * @param {string} manifestDir * @param {boolean} hasDevGroup * @param {string} poetryBin * @returns {string} */ _getPoetryShowTreeOutput(manifestDir: string, hasDevGroup: boolean, poetryBin: string): string; /** * Get poetry show --all output (flat list with resolved versions). * @param {string} manifestDir * @param {string} poetryBin * @returns {string} */ _getPoetryShowAllOutput(manifestDir: string, poetryBin: string): string; /** * Parse poetry show --all output into a version map. * Lines look like: "name (!) 1.2.3 Description text..." * or: "name 1.2.3 Description text..." * @param {string} output * @returns {Map} canonical name -> version */ _parsePoetryShowAll(output: string): Map; /** * Collects PEP 508 marker expressions for direct and transitive deps. * Direct markers come from pyproject.toml dependency strings, e.g.: * "pywin32>=311 ; sys_platform == 'win32'" → directMarkers['pywin32'] = "sys_platform == 'win32'" * Transitive markers come from poetry.lock [package.dependencies] entries, e.g.: * colorama = {version = "*", markers = "sys_platform == 'win32'"} * → transitiveMarkers['click']['colorama'] = "sys_platform == 'win32'" * @param {string|null} lockDir * @param {object} parsed - parsed pyproject.toml * @returns {{directMarkers: Map, transitiveMarkers: Map>, hashMap: Map>}} */ _extractMarkerData(lockDir: string | null, parsed: object): { directMarkers: Map; transitiveMarkers: Map>; hashMap: Map>; }; /** * Extract a SHA-256 hex digest from poetry.lock files array. * Prefers the sdist (.tar.gz) hash; falls back to the first wheel hash. * @param {Array<{file: string, hash: string}>} [files] * @returns {string|null} */ _extractSha256FromFiles(files?: Array<{ file: string; hash: string; }>): string | null; /** * Parse poetry show --tree output into a dependency graph structure. * * @param {string} treeOutput * @param {Map} versionMap - canonical name -> resolved version * @param {{directMarkers: Map, transitiveMarkers: Map>, hashMap: Map>}} markerData * @returns {{directDeps: string[], graph: Map}>}} */ _parsePoetryTree(treeOutput: string, versionMap: Map, markerData: { directMarkers: Map; transitiveMarkers: Map>; hashMap: Map>; }): { directDeps: string[]; graph: Map; }>; }; }