Skip to content

Commit

Permalink
Revert "Python-Setup: set PYTHONDONTWRITEBYTECODE=1"
Browse files Browse the repository at this point in the history
This reverts commit 3ff1fd9.
  • Loading branch information
Arthur Baars committed Jun 27, 2022
1 parent 3ff1fd9 commit 95673cf
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
}
Expand Down

0 comments on commit 95673cf

Please sign in to comment.