Files
2025-12-27 21:16:10 -08:00

55 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
VENV_DIR="${VENV_DIR}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(realpath "$SCRIPT_DIR/..")"
echo "From '$SCRIPT_DIR' to '$PROJECT_ROOT'"
cd "$PROJECT_ROOT"
# Create the directory where the files generated by the tests will be stored
mkdir -p project/uploaded_files
# Create and activate Python virtual environment
python3 -m venv "$VENV_DIR"
source "$VENV_DIR/bin/activate"
# Install Rust if not already installed
if ! command -v rustc >/dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
fi
source "$HOME/.cargo/env"
# Install Python dependencies
pip install -r server_requirements.txt
pip install maturin
pip install pytest
pip install pytest-rerunfailures
pip install pandas
pip install matplotlib
# Check for C compiler (cc)
if ! command -v cc >/dev/null 2>&1; then
echo "No C compiler (cc) found on this system."
case "$(uname)" in
Linux)
echo "You can install it with:"
echo " sudo apt update && sudo apt install -y build-essential"
;;
Darwin)
echo "You can install it with:"
echo " xcode-select --install"
;;
*)
echo "Unsupported OS for build-essential installation. Please install C/C++ build tools manually."
;;
esac
exit 1
fi
# Print installed versions
echo "✔️ cargo --version: $(cargo --version)"
echo "✔️ rustc --version: $(rustc --version)"
echo "✔️ cc --version : $(cc --version)"