mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Python: Move Python language pack tooling to external repo
This is essentially the contents of `language-packs/python/tools` with some minor modifications to account for the changed location. Of note: we explicitly exclude the `recorded-call-graph-metrics` director that was already present in `python/tools`. When we revisit this directory for some cleanup (e.g. to get rid of the `lgtm` references), we'll probably want to switch to an explicit list of sources to include.
This commit is contained in:
11
python/tools/BUILD.bazel
Normal file
11
python/tools/BUILD.bazel
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
load("@semmle_code//:dist.bzl", "pack_zip")
|
||||||
|
|
||||||
|
pack_zip(
|
||||||
|
name = "tools",
|
||||||
|
srcs = glob(["**/*"]),
|
||||||
|
excludes = [
|
||||||
|
"BUILD.bazel",
|
||||||
|
] + glob(["recorded-call-graph-metrics/**"]),
|
||||||
|
prefix = "tools",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
||||||
8
python/tools/autobuild.cmd
Normal file
8
python/tools/autobuild.cmd
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
rem Legacy environment variables for the autobuild infrastructure.
|
||||||
|
set LGTM_SRC=%CD%
|
||||||
|
set LGTM_WORKSPACE=%CODEQL_EXTRACTOR_PYTHON_SCRATCH_DIR%
|
||||||
|
|
||||||
|
type NUL && python "%CODEQL_EXTRACTOR_PYTHON_ROOT%\tools\index.py"
|
||||||
|
exit /b %ERRORLEVEL%
|
||||||
18
python/tools/autobuild.sh
Executable file
18
python/tools/autobuild.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
# Legacy environment variables for the autobuild infrastructure.
|
||||||
|
LGTM_SRC="$(pwd)"
|
||||||
|
LGTM_WORKSPACE="$CODEQL_EXTRACTOR_PYTHON_SCRATCH_DIR"
|
||||||
|
export LGTM_SRC
|
||||||
|
export LGTM_WORKSPACE
|
||||||
|
|
||||||
|
if which python3 >/dev/null; then
|
||||||
|
exec python3 "$CODEQL_EXTRACTOR_PYTHON_ROOT/tools/index.py"
|
||||||
|
elif which python >/dev/null; then
|
||||||
|
exec python "$CODEQL_EXTRACTOR_PYTHON_ROOT/tools/index.py"
|
||||||
|
else
|
||||||
|
echo "ERROR: Could not find a valid Python distribution. It should be available when running 'which python' or 'which python3' in your shell. Python 2 is no longer supported."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
3
python/tools/lgtm-scripts/index.cmd
Normal file
3
python/tools/lgtm-scripts/index.cmd
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
py "%CODEQL_EXTRACTOR_PYTHON_ROOT%\tools\index.py"
|
||||||
5
python/tools/lgtm-scripts/index.sh
Executable file
5
python/tools/lgtm-scripts/index.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
python "${CODEQL_EXTRACTOR_PYTHON_ROOT}/tools/index.py"
|
||||||
3
python/tools/lgtm-scripts/python_setup.cmd
Normal file
3
python/tools/lgtm-scripts/python_setup.cmd
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
py "%CODEQL_EXTRACTOR_PYTHON_ROOT%\tools\setup.py" || EXIT /B 0
|
||||||
5
python/tools/lgtm-scripts/python_setup.sh
Executable file
5
python/tools/lgtm-scripts/python_setup.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
python "${CODEQL_EXTRACTOR_PYTHON_ROOT}/tools/setup.py" || true
|
||||||
11
python/tools/pre-finalize.cmd
Normal file
11
python/tools/pre-finalize.cmd
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
type NUL && "%CODEQL_DIST%\codeql" database index-files ^
|
||||||
|
--include-extension=.yaml ^
|
||||||
|
--include-extension=.yml ^
|
||||||
|
--size-limit=5m ^
|
||||||
|
--language yaml ^
|
||||||
|
-- ^
|
||||||
|
"%CODEQL_EXTRACTOR_PYTHON_WIP_DATABASE%"
|
||||||
|
|
||||||
|
exit /b %ERRORLEVEL%
|
||||||
11
python/tools/pre-finalize.sh
Executable file
11
python/tools/pre-finalize.sh
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
"$CODEQL_DIST/codeql" database index-files \
|
||||||
|
--include-extension=.yaml \
|
||||||
|
--include-extension=.yml \
|
||||||
|
--size-limit=5m \
|
||||||
|
--language yaml \
|
||||||
|
-- \
|
||||||
|
"$CODEQL_EXTRACTOR_PYTHON_WIP_DATABASE"
|
||||||
Reference in New Issue
Block a user