- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquickstart.sh
More file actions
Latest commit
61 lines (51 loc) · 1.57 KB
/
Copy pathquickstart.sh
File metadata and controls
61 lines (51 loc) · 1.57 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
#!/bin/bash
# Quick start script for OpenCode Python
set -e
echo"🚀 OpenCode Python - Quick Start"
echo"================================="
echo""
# Check Python version
echo"📋 Checking Python version..."
python_version=$(python --version 2>&1| awk '{print $2}')
echo" Found Python $python_version"
# Check if we're in the right directory
if [ !-f"pyproject.toml" ];then
echo"❌ Error: pyproject.toml not found!"
echo" Please run this script from the python/ directory"
exit 1
fi
# Create virtual environment if it doesn't exist
if [ !-d"venv" ];then
echo"📦 Creating virtual environment..."
python -m venv venv
fi
# Activate virtual environment
echo"🔌 Activating virtual environment..."
if [[ "$OSTYPE"=="msys"||"$OSTYPE"=="win32" ]];then
source venv/Scripts/activate
else
source venv/bin/activate
fi
# Install package
echo"📥 Installing OpenCode..."
pip install -q -e ".[dev]"
# Run tests
echo"🧪 Running tests..."
if pytest tests/ -q --tb=short 2>/dev/null;then
echo" ✅ All tests passed!"
else
echo" ⚠️ Some tests failed (this is normal for initial setup)"
fi
# Run examples
echo""
echo"🎨 Running examples..."
python examples/basic_usage.py ||echo" Examples completed"
echo""
echo"✅ Setup complete!"
echo""
echo"🎯 Next steps:"
echo" 1. Activate virtual environment: source venv/bin/activate (or venv\\Scripts\\activate on Windows)"
echo" 2. Try the CLI: opencode --help"
echo" 3. Run tests: pytest tests/ -v"
echo" 4. See BUILD_AND_RUN.md for detailed instructions"
echo""