-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
86 lines (72 loc) · 2.37 KB
/
Copy pathsetup.sh
File metadata and controls
86 lines (72 loc) · 2.37 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# Wayfarer Multi-Agent Travel Concierge Setup Script
set -e # Exit on any error
echo "Setting up Wayfarer Multi-Agent Travel Concierge..."
# Check if Python 3.8+ is available
if ! command -v python3 &> /dev/null; then
echo "Error: Python 3 is required but not installed."
exit 1
fi
PYTHON_VERSION=$(python3 --version | cut -d' ' -f2 | cut -d'.' -f1-2)
REQUIRED_VERSION="3.8"
if [ "$(printf '%s\n' "$REQUIRED_VERSION" "$PYTHON_VERSION" | sort -V | head -n1)" = "$REQUIRED_VERSION" ] && [ "$PYTHON_VERSION" != "$REQUIRED_VERSION" ]; then
if [ "$(printf '%s\n' "$REQUIRED_VERSION" "$PYTHON_VERSION" | sort -V | head -n1)" = "$REQUIRED_VERSION" ]; then
echo "Error: Python $REQUIRED_VERSION or higher is required. You have $PYTHON_VERSION."
exit 1
fi
fi
echo "Python version: $PYTHON_VERSION (OK)"
# Create virtual environment if it doesn't exist
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
else
echo "Virtual environment already exists."
fi
# Activate virtual environment
echo "Activating virtual environment..."
source venv/bin/activate
# Upgrade pip
echo "Upgrading pip..."
pip install --upgrade pip
# Install main dependencies
echo "Installing dependencies..."
pip install -r requirements.txt
# Install development dependencies
if [ -f "requirements-dev.txt" ]; then
echo "Installing development dependencies..."
pip install -r requirements-dev.txt
fi
# Install pre-commit hooks
if [ -f ".pre-commit-config.yaml" ]; then
echo "Installing pre-commit hooks..."
pip install pre-commit
pre-commit install
fi
# Create .env file if it doesn't exist
if [ ! -f ".env" ]; then
echo "Creating .env template..."
cat > .env << EOF
# Environment variables for Wayfarer Multi-Agent Travel Concierge
DATABASE_URL=postgresql://user:password@localhost:5432/wayfarer
GROQ_API_KEY=your_groq_api_key_here
AVIATIONSTACK_API_KEY=your_aviationstack_api_key_here
TAVILY_API_KEY=your_tavily_api_key_here
EOF
echo "Please edit .env file with your actual API keys"
fi
# Create necessary directories
mkdir -p travel_plans
mkdir -p logs
echo "Setup complete!"
echo ""
echo "To activate the virtual environment in the future, run:"
echo " source venv/bin/activate"
echo ""
echo "To run the application:"
echo " streamlit run app.py"
echo ""
echo "To run tests:"
echo " pytest"
echo ""
echo "Happy coding!"