great-ai/scripts/check-python.sh
Andras Schmelczer c55eba2077
All checks were successful
Publish documentation / publish (push) Successful in 51s
Check / Test on Python 3.10 (push) Successful in 1m1s
Check / Lint, format & type checks (push) Successful in 1m9s
Check / Test on Python 3.11 (push) Successful in 51s
Check / Test on Python 3.12 (push) Successful in 58s
Check / Test on Python 3.13 (push) Successful in 55s
Add max deps and bump old ones
2026-06-06 22:29:16 +01:00

25 lines
1,004 B
Bash
Executable file

#!/bin/sh
set -e
echo "Installing dependencies if necessary"
python3 -m pip install autoflake isort black[jupyter] mypy flake8
for dir in "$@"; do
echo "Checking $dir"
cd "$dir"
python3 -m autoflake --expand-star-imports --remove-all-unused-imports --ignore-init-module-imports --remove-unused-variables --in-place -r . --check
python3 -m isort --profile black --skip .env . --check
python3 -m black . --exclude .env --check
if find . -name "*.py" 2>/dev/null | grep -q .; then
yes | python3 -m mypy . --install-types > /dev/null || true
python3 -m mypy --namespace-packages --ignore-missing-imports --install-types --non-interactive --disallow-untyped-defs --disallow-incomplete-defs --follow-imports=silent --exclude=external/ --exclude=/build/ --exclude='(^|/)__main__\.py$' --pretty .
fi
python3 -m flake8 . --count --show-source --statistics --exclude=__init__.py,.env,external --extend-ignore=E501,E402,F821,W503,E722,E203,E704
cd -
done