Revert "Python-Setup: set PYTHONDONTWRITEBYTECODE=1"
This reverts commit 3ff1fd9192.
This commit is contained in:
parent
3ff1fd9192
commit
95673cf9a2
1 changed files with 7 additions and 8 deletions
15
src/init.ts
15
src/init.ts
|
|
@ -240,14 +240,13 @@ export async function installPythonDeps(codeql: CodeQL, logger: Logger) {
|
||||||
const scriptsFolder = path.resolve(__dirname, "../python-setup");
|
const scriptsFolder = path.resolve(__dirname, "../python-setup");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const env = { ...process.env, PYTHONDONTWRITEBYTECODE: "1" };
|
|
||||||
if (process.platform === "win32") {
|
if (process.platform === "win32") {
|
||||||
await new toolrunner.ToolRunner(await safeWhich.safeWhich("powershell"), [
|
await new toolrunner.ToolRunner(await safeWhich.safeWhich("powershell"), [
|
||||||
path.join(scriptsFolder, "install_tools.ps1"),
|
path.join(scriptsFolder, "install_tools.ps1"),
|
||||||
], { env: env }).exec();
|
]).exec();
|
||||||
} else {
|
} else {
|
||||||
await new toolrunner.ToolRunner(
|
await new toolrunner.ToolRunner(
|
||||||
path.join(scriptsFolder, "install_tools.sh"), [], { env: env }
|
path.join(scriptsFolder, "install_tools.sh")
|
||||||
).exec();
|
).exec();
|
||||||
}
|
}
|
||||||
const script = "auto_install_packages.py";
|
const script = "auto_install_packages.py";
|
||||||
|
|
@ -256,19 +255,19 @@ export async function installPythonDeps(codeql: CodeQL, logger: Logger) {
|
||||||
"-3",
|
"-3",
|
||||||
path.join(scriptsFolder, script),
|
path.join(scriptsFolder, script),
|
||||||
path.dirname(codeql.getPath()),
|
path.dirname(codeql.getPath()),
|
||||||
], { env: env }).exec();
|
]).exec();
|
||||||
} else {
|
} else {
|
||||||
await new toolrunner.ToolRunner(path.join(scriptsFolder, script), [
|
await new toolrunner.ToolRunner(path.join(scriptsFolder, script), [
|
||||||
path.dirname(codeql.getPath()),
|
path.dirname(codeql.getPath()),
|
||||||
], { env: env }).exec();
|
]).exec();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.endGroup();
|
logger.endGroup();
|
||||||
logger.warning(
|
logger.warning(
|
||||||
`An error occurred while trying to automatically install Python dependencies: ${e}\n` +
|
`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 " +
|
"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 " +
|
"step, and add a 'setup-python-dependencies: false' argument to this step to disable our automatic " +
|
||||||
"dependency installation and avoid this warning."
|
"dependency installation and avoid this warning."
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue