Feature flag to disable python dependency installation

This commit is contained in:
Rasmus Wriedt Larsen 2023-05-09 10:13:30 +02:00
parent 95cfca769b
commit 0ccdbf8cd5
No known key found for this signature in database
9 changed files with 91 additions and 15 deletions

View file

@ -87,6 +87,20 @@ async function setupPythonExtractor(logger: Logger) {
return;
}
// CODEQL_EXTRACTOR_PYTHON_DISABLE_LIBRARY_EXTRACTION is the internal environment
// variable used by the python extractor. This is set in init-action.ts only if the
// feature-flag is enabled.
if (
(process.env["CODEQL_EXTRACTOR_PYTHON_DISABLE_LIBRARY_EXTRACTION"] || "")
.length > 0
) {
logger.warning(
"Library extraction is disabled now. Please remove your logic that sets the CODEQL_PYTHON environment variable." +
"\nIf you used CODEQL_PYTHON to force the version of Python to analyze as, please use CODEQL_EXTRACTOR_PYTHON_ANALYSIS_VERSION instead, such as CODEQL_EXTRACTOR_PYTHON_ANALYSIS_VERSION=2.7 or CODEQL_EXTRACTOR_PYTHON_ANALYSIS_VERSION=3.11."
);
return;
}
const scriptsFolder = path.resolve(__dirname, "../python-setup");
let output = "";