From 95673cf9a24726be6698bade703a6c87ead494bc Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Mon, 27 Jun 2022 16:34:35 +0200 Subject: [PATCH] Revert "Python-Setup: set PYTHONDONTWRITEBYTECODE=1" This reverts commit 3ff1fd919260c51f56ec5b38bf8a78fac3991f5a. --- src/init.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/init.ts b/src/init.ts index 4e6b0c675..a674cb19f 100644 --- a/src/init.ts +++ b/src/init.ts @@ -240,14 +240,13 @@ export async function installPythonDeps(codeql: CodeQL, logger: Logger) { const scriptsFolder = path.resolve(__dirname, "../python-setup"); try { - const env = { ...process.env, PYTHONDONTWRITEBYTECODE: "1" }; if (process.platform === "win32") { await new toolrunner.ToolRunner(await safeWhich.safeWhich("powershell"), [ path.join(scriptsFolder, "install_tools.ps1"), - ], { env: env }).exec(); + ]).exec(); } else { await new toolrunner.ToolRunner( - path.join(scriptsFolder, "install_tools.sh"), [], { env: env } + path.join(scriptsFolder, "install_tools.sh") ).exec(); } const script = "auto_install_packages.py"; @@ -256,19 +255,19 @@ export async function installPythonDeps(codeql: CodeQL, logger: Logger) { "-3", path.join(scriptsFolder, script), path.dirname(codeql.getPath()), - ], { env: env }).exec(); + ]).exec(); } else { await new toolrunner.ToolRunner(path.join(scriptsFolder, script), [ path.dirname(codeql.getPath()), - ], { env: env }).exec(); + ]).exec(); } } catch (e) { logger.endGroup(); logger.warning( `An error occurred while trying to automatically install Python dependencies: ${e}\n` + - "Please make sure any necessary dependencies are installed before calling the codeql-action/analyze " + - "step, and add a 'setup-python-dependencies: false' argument to this step to disable our automatic " + - "dependency installation and avoid this warning." + "Please make sure any necessary dependencies are installed before calling the codeql-action/analyze " + + "step, and add a 'setup-python-dependencies: false' argument to this step to disable our automatic " + + "dependency installation and avoid this warning." ); return; }