@@ -240,13 +240,14 @@ export async function installPythonDeps(codeql: CodeQL, logger: Logger) {
240
240
const scriptsFolder = path . resolve ( __dirname , "../python-setup" ) ;
241
241
242
242
try {
243
+ const env = { ...process . env , PYTHONDONTWRITEBYTECODE : "1" } ;
243
244
if ( process . platform === "win32" ) {
244
245
await new toolrunner . ToolRunner ( await safeWhich . safeWhich ( "powershell" ) , [
245
246
path . join ( scriptsFolder , "install_tools.ps1" ) ,
246
- ] ) . exec ( ) ;
247
+ ] , { env : env } ) . exec ( ) ;
247
248
} else {
248
249
await new toolrunner . ToolRunner (
249
- path . join ( scriptsFolder , "install_tools.sh" )
250
+ path . join ( scriptsFolder , "install_tools.sh" ) , [ ] , { env : env }
250
251
) . exec ( ) ;
251
252
}
252
253
const script = "auto_install_packages.py" ;
@@ -255,19 +256,19 @@ export async function installPythonDeps(codeql: CodeQL, logger: Logger) {
255
256
"-3" ,
256
257
path . join ( scriptsFolder , script ) ,
257
258
path . dirname ( codeql . getPath ( ) ) ,
258
- ] ) . exec ( ) ;
259
+ ] , { env : env } ) . exec ( ) ;
259
260
} else {
260
261
await new toolrunner . ToolRunner ( path . join ( scriptsFolder , script ) , [
261
262
path . dirname ( codeql . getPath ( ) ) ,
262
- ] ) . exec ( ) ;
263
+ ] , { env : env } ) . exec ( ) ;
263
264
}
264
265
} catch ( e ) {
265
266
logger . endGroup ( ) ;
266
267
logger . warning (
267
268
`An error occurred while trying to automatically install Python dependencies: ${ e } \n` +
268
- "Please make sure any necessary dependencies are installed before calling the codeql-action/analyze " +
269
- "step, and add a 'setup-python-dependencies: false' argument to this step to disable our automatic " +
270
- "dependency installation and avoid this warning."
269
+ "Please make sure any necessary dependencies are installed before calling the codeql-action/analyze " +
270
+ "step, and add a 'setup-python-dependencies: false' argument to this step to disable our automatic " +
271
+ "dependency installation and avoid this warning."
271
272
) ;
272
273
return ;
273
274
}
0 commit comments