Skip to content

Commit dfe2f1a

Browse files
authored
Merge pull request #16127 from RasmusWL/remove-dep-inst-fallback
Python: Extractor: Remove dependency installation fallback
2 parents 2256c4c + 4faff83 commit dfe2f1a

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

Diff for: python/extractor/buildtools/index.py

+4-21
Original file line numberDiff line numberDiff line change
@@ -76,28 +76,11 @@ def get_filter_options():
7676
return []
7777

7878
def get_path_options(version):
79-
# We want to stop extracting libraries, and only extract the code that is in the
80-
# repo. While in the transition period for stopping to install dependencies in the
81-
# codeql-action, we will need to be able to support both old and new behavior.
82-
#
83-
# Like PYTHONUNBUFFERED for Python, we treat any non-empty string as meaning the
84-
# flag is enabled.
85-
# https://docs.python.org/3/using/cmdline.html#envvar-PYTHONUNBUFFERED
86-
if os.environ.get("CODEQL_EXTRACTOR_PYTHON_DISABLE_LIBRARY_EXTRACTION"):
87-
return []
79+
# Before 2.17.1 it was possible to extract installed libraries
80+
# where this function would return ["-p", "/path/to/library"].
81+
# However, from 2.17.1 onwards, this is no longer supported.
8882

89-
# Not extracting dependencies will be default in CodeQL CLI release 2.16.0. Until
90-
# 2.17.0, we provide an escape hatch to get the old behavior.
91-
force_enable_envvar_name = "CODEQL_EXTRACTOR_PYTHON_FORCE_ENABLE_LIBRARY_EXTRACTION_UNTIL_2_17_0"
92-
if os.environ.get(force_enable_envvar_name):
93-
print("WARNING: We plan to remove the availability of the {} option in CodeQL CLI release 2.17.0 and beyond. Please let us know by submitting an issue to https://github.com/github/codeql why you needed to re-enable dependency extraction.".format(force_enable_envvar_name))
94-
path_option = [ "-p", install.get_library(version)]
95-
if PATH_TAG in os.environ:
96-
path_option = split_into_options(os.environ[PATH_TAG], "-p") + path_option
97-
return path_option
98-
else:
99-
print("INFO: The Python extractor has recently (from 2.16.0 CodeQL CLI release) stopped extracting dependencies by default, and therefore stopped analyzing the source code of dependencies by default. We plan to remove this entirely in CodeQL CLI release 2.17.0. If you encounter problems, please let us know by submitting an issue to https://github.com/github/codeql, so we can consider adjusting our plans. It is possible to re-enable dependency extraction by exporting '{}=1'.".format(force_enable_envvar_name))
100-
return []
83+
return []
10184

10285
def get_stdlib():
10386
return os.path.dirname(os.__file__)

0 commit comments

Comments
 (0)