[CI] Pass local python version explicitly to pre-commit mypy.sh (#12224)

Signed-off-by: Chen Zhang <zhangch99@outlook.com>
This commit is contained in:
Chen Zhang
2025-01-20 23:49:18 +08:00
committed by GitHub
parent 18572e3384
commit 96663699b2
2 changed files with 6 additions and 2 deletions

View File

@@ -1,12 +1,16 @@
#!/bin/bash
CI=${1:-0}
PYTHON_VERSION=${2:-3.9}
PYTHON_VERSION=${2:-local}
if [ "$CI" -eq 1 ]; then
set -e
fi
if [ $PYTHON_VERSION == "local" ]; then
PYTHON_VERSION=$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
fi
run_mypy() {
echo "Running mypy on $1"
if [ "$CI" -eq 1 ] && [ -z "$1" ]; then