Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/providers/python_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ export default class Python_controller {
throw new Error('fail invoking pip freeze to fetch all installed dependencies in environment --> ' + err.message)
}
}).toString();
//debug
// freezeOutput = "alternative pip freeze output goes here for debugging"
let lines = freezeOutput.split(EOL)
let depNames = lines.map( line => getDependencyName(line)).join(" ")
let pipShowOutput = execSync(`${this.pathToPipBin} show ${depNames}`, err =>{
Expand All @@ -157,7 +159,7 @@ export default class Python_controller {
}
}).toString();
let allPipShowDeps = pipShowOutput.split( EOL +"---" + EOL);
let matchManifestVersions = getCustom("MATCH_MANIFEST_VERSIONS","true");
let matchManifestVersions = getCustom("MATCH_MANIFEST_VERSIONS","true",this.options);
let linesOfRequirements = fs.readFileSync(this.pathToRequirements).toString().split(EOL).filter( (line) => !line.startsWith("#")).map(line => line.trim())
let CachedEnvironmentDeps = {}
allPipShowDeps.forEach( (record) => {
Expand Down
2 changes: 1 addition & 1 deletion src/providers/python_pip.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function getSbomForComponentAnalysis(data, opts = {}) {
let tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'exhort_'))
let tmpRequirementsPath = path.join(tmpDir, 'requirements.txt')
fs.writeFileSync(tmpRequirementsPath, data)
let pythonController = new Python_controller(createVirtualPythonEnv === "false",binaries.pip,binaries.python,tmpRequirementsPath)
let pythonController = new Python_controller(createVirtualPythonEnv === "false",binaries.pip,binaries.python,tmpRequirementsPath,opts)
let dependencies = pythonController.getDependencies(false);
let sbom = new Sbom();
sbom.addRoot(toPurl("root",undefined))
Expand Down