File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 4040 run : |
4141 source .venv-pyodide/bin/activate
4242 python testing/install_pyodide_libs.py
43+
44+ - name : Run python files in pyodide environment
45+ run : |
46+ source .venv-pyodide/bin/activate
47+ bash testing/run_py_files.sh testing/py_files
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Exit immediately if a command fails
4+ set -e
5+
6+ # Check if a directory argument is provided
7+ if [ $# -eq 0 ]; then
8+ echo " Usage: $0 <directory>"
9+ exit 1
10+ fi
11+
12+ TARGET_DIR=" $1 "
13+
14+ # Ensure the directory exists
15+ if [ ! -d " $TARGET_DIR " ]; then
16+ echo " Error: Directory '$TARGET_DIR ' does not exist."
17+ exit 1
18+ fi
19+
20+ # Find and execute all Python files
21+ echo " Searching for Python files in $TARGET_DIR ..."
22+ PYTHON_FILES=$( find " $TARGET_DIR " -type f -name " *.py" )
23+
24+ if [ -z " $PYTHON_FILES " ]; then
25+ echo " No Python files found in $TARGET_DIR "
26+ exit 0
27+ fi
28+
29+ # Run each Python file
30+ for file in $PYTHON_FILES ; do
31+ echo " Running: $file "
32+ MPLBACKEND=Agg python " $file "
33+ done
34+
35+ echo " ✅ All scripts ran successfully!"
You can’t perform that action at this time.
0 commit comments