@snyk/fix-poetry
Advanced tools
Comparing version 0.6.1 to 0.7.0
@@ -5,2 +5,3 @@ import Bottleneck from 'bottleneck'; | ||
dev?: boolean; | ||
python?: string; | ||
} | ||
@@ -7,0 +8,0 @@ export declare const poetryAdd: ((arg1: string, arg2: string[], arg3: PoetryConfig) => Promise<ExecuteResponse>) & { |
@@ -17,2 +17,14 @@ "use strict"; | ||
} | ||
if (config.python) { | ||
try { | ||
// tell poetry to use the given interpreter | ||
// https://python-poetry.org/docs/managing-environments/ | ||
await child_process_1.execute('poetry', ['env', 'use', config.python], { | ||
cwd: projectPath, | ||
}); | ||
} | ||
catch (e) { | ||
debug(`'poetry use env ${config.python}' failed with`, e); | ||
} | ||
} | ||
try { | ||
@@ -27,2 +39,13 @@ res = await child_process_1.execute('poetry', args, { | ||
} | ||
if (config.python) { | ||
try { | ||
// set it back to system python | ||
await child_process_1.execute('poetry', ['env', 'use', 'system'], { | ||
cwd: projectPath, | ||
}); | ||
} | ||
catch (e) { | ||
debug(`'poetry use env system' failed with`, e); | ||
} | ||
} | ||
return res; | ||
@@ -29,0 +52,0 @@ } |
{ | ||
"name": "@snyk/fix-poetry", | ||
"description": "Snyk python ecosystem fix remediation", | ||
"version": "0.6.1", | ||
"version": "0.7.0", | ||
"main": "dist/index.js", | ||
@@ -68,3 +68,3 @@ "scripts": { | ||
}, | ||
"gitHead": "6d3b6c46c36aaf16a569e6a33844393335b3ef00" | ||
"gitHead": "af445d66db80f91a858940e762d89f19a2d330a4" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10565
140