Skip to content

Commit

Permalink
Fix CI-scripts for JavaScript components.
Browse files Browse the repository at this point in the history
The CI-scripts assumed `python` is available on the path, but this is not necessarily the case for the JavaScript components.
  • Loading branch information
fniessink authored and wkoot committed Jul 4, 2024
1 parent 64369e3 commit b5a9c47
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 408 deletions.
5 changes: 4 additions & 1 deletion ci/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ script_dir() {
}

# For Windows compatibility; prevent path from ending with a ':'
export PYTHONPATH=$(python -c 'import sys;print(":".join(sys.argv[1:]))' src $PYTHONPATH)
if command -v python &> /dev/null
then
export PYTHONPATH=$(python -c 'import sys;print(":".join(sys.argv[1:]))' src $PYTHONPATH)
fi
12 changes: 8 additions & 4 deletions ci/quality-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@

source pipx-base.sh

PYTHON_FILES_AND_FOLDERS=$(python $(script_dir)/python_files_and_folders.py)
python_files_and_folders() {
echo $(python $(script_dir)/python_files_and_folders.py)
}

run_ruff() {
PYTHON_FILES_AND_FOLDERS=$(python_files_and_folders)
run_pipx ruff check $PYTHON_FILES_AND_FOLDERS
run_pipx ruff format --check $PYTHON_FILES_AND_FOLDERS
}

run_fixit() {
run_pipx fixit lint $PYTHON_FILES_AND_FOLDERS
run_pipx fixit lint $(python_files_and_folders)
}

run_mypy() {
PYTHON_FILES_AND_FOLDERS=$(python_files_and_folders)
# Run mypy with or without pydantic plugin depending on whether pydantic is listed as dependency in the tools
# section of the optional dependencies in the pyproject.toml file.
pydantic_spec=$(spec pydantic)
Expand All @@ -32,15 +36,15 @@ run_pyproject_fmt() {
}

run_bandit() {
run_pipx bandit --configfile pyproject.toml --quiet --recursive $PYTHON_FILES_AND_FOLDERS
run_pipx bandit --configfile pyproject.toml --quiet --recursive $(python_files_and_folders)
}

run_pip_audit() {
run_pipx pip-audit --strict --progress-spinner=off $(python $(script_dir)/requirements_files.py "-r %s")
}

run_vulture() {
run_pipx vulture --min-confidence 0 $PYTHON_FILES_AND_FOLDERS .vulture_ignore_list.py $@
run_pipx vulture --min-confidence 0 $(python_files_and_folders) .vulture_ignore_list.py $@
}

run_vale() {
Expand Down
Loading

0 comments on commit b5a9c47

Please sign in to comment.