-
Notifications
You must be signed in to change notification settings - Fork 852
Expand file tree
/
Copy pathrun_validation.sh
More file actions
executable file
·30 lines (22 loc) · 1.08 KB
/
run_validation.sh
File metadata and controls
executable file
·30 lines (22 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# all: ./scripts/run_validation.sh
# single: ./scripts/run_validation.sh tests/slack_sdk_async/web/test_web_client_coverage.py
script_dir=`dirname $0`
cd ${script_dir}/..
# keep in sync with LATEST_SUPPORTED_PY in .github/workflows/ci-build.yml
LATEST_SUPPORTED_PY="3.14"
current_py=$(python --version | sed -E 's/Python ([0-9]+\.[0-9]+).*/\1/')
./scripts/install.sh
set -e
echo "Generating code ..." && python scripts/codegen.py --path .
# Run mypy type checking only on the latest supported Python version
if [[ "$current_py" == "$LATEST_SUPPORTED_PY" ]]; then
echo "Running black (code formatter) ..." && ./scripts/format.sh --no-install
echo "Running linting checks ..." && ./scripts/lint.sh --no-install
echo "Running mypy type checking ..." && ./scripts/run_mypy.sh --no-install
else
echo "Skipping formatting, linting, and type checking (current Python: $current_py, required: $LATEST_SUPPORTED_PY)"
fi
echo "Running tests with coverage reporting ..."
test_target="${1:-tests/}"
PYTHONPATH=$PWD:$PYTHONPATH pytest --cov-report=xml --cov=slack_sdk/ $test_target