Starting on Python inference

This commit is contained in:
Michael Hansen
2023-02-26 23:03:11 -06:00
parent 0ddfb082be
commit b21d815298
13 changed files with 346 additions and 0 deletions

29
src/python_run/scripts/check.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Runs formatters, linters, and type checkers on Python code.
set -eo pipefail
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
base_dir="$(realpath "${this_dir}/..")"
# Path to virtual environment
: "${venv:=${base_dir}/.venv}"
if [ -d "${venv}" ]; then
# Activate virtual environment if available
source "${venv}/bin/activate"
fi
python_files=("${base_dir}/larynx")
# Format code
black "${python_files[@]}"
isort "${python_files[@]}"
# Check
flake8 "${python_files[@]}"
pylint "${python_files[@]}"
mypy "${python_files[@]}"